Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrato committed Nov 1, 2024
1 parent ac1b0bc commit aa65d80
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/kube-integration-tests-non-root.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ jobs:
cp -r $HOME/.kube /home/
chown -R ci:ci /home/.kube
- name: Build Alpine image with webserver
run: |
docker load -i ./fixtures/alpine/alpine-3.23.amd64.tar
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./fixtures/alpine/webserver ./fixtures/alpine/webserver.go
docker build -t alpine-webserver:latest -f ./fixtures/alpine/Dockerfile ./fixtures/alpine/
kind load docker-image alpine-webserver:latest
rm -f ./fixtures/alpine/webserver
- name: Run tests
timeout-minutes: 40
run: |
Expand Down
5 changes: 5 additions & 0 deletions fixtures/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:3.20.3

COPY webserver /webserver

CMD [ "/webserver" ]
Binary file added fixtures/alpine/alpine-3.23.amd64.tar
Binary file not shown.
Binary file added fixtures/alpine/webserver
Binary file not shown.
26 changes: 26 additions & 0 deletions fixtures/alpine/webserver.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Teleport
// Copyright (C) 2024 Gravitational, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

package main

import "net/http"

func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello, world!"))
})
http.ListenAndServe(":80", nil)
}
6 changes: 5 additions & 1 deletion integration/kube_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ func newKubeSuite(t *testing.T) *KubeSuite {
// Wait for pod to be running.
require.Eventually(t, func() bool {
rsp, err := suite.CoreV1().Pods(testNamespace).Get(context.Background(), testPod, metav1.GetOptions{})
fmt.Println(rsp, err)
if rsp != nil {
fmt.Println(rsp.Status)
}
if err != nil {
return false
}
Expand Down Expand Up @@ -1937,7 +1941,7 @@ func newPod(ns, name string) *v1.Pod {
Spec: v1.PodSpec{
Containers: []v1.Container{{
Name: "nginx",
Image: "nginx:alpine",
Image: "alpine-webserver:latest",
}},
},
}
Expand Down

0 comments on commit aa65d80

Please sign in to comment.