mirror of
https://github.com/k3s-io/k3s.git
synced 2026-02-20 00:10:20 -05:00
Add e2e tests
This commit is contained in:
parent
10f1553564
commit
d6c5f6b995
3 changed files with 53 additions and 0 deletions
6
e2e/Dockerfile
Normal file
6
e2e/Dockerfile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
FROM ubuntu:18.04
|
||||
RUN apt-get update && \
|
||||
apt-get install -y curl
|
||||
RUN curl -sfL https://github.com/heptio/sonobuoy/releases/download/v0.13.0/sonobuoy_0.13.0_linux_amd64.tar.gz | tar xvzf - -C /usr/bin
|
||||
COPY run-test.sh /usr/bin
|
||||
CMD ["/usr/bin/run-test.sh"]
|
||||
31
e2e/docker-compose.yml
Normal file
31
e2e/docker-compose.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
version: '3'
|
||||
services:
|
||||
server:
|
||||
image: rancher/k3s:v0.1.0-rc8
|
||||
command: server
|
||||
environment:
|
||||
- K3S_CLUSTER_SECRET=somethingtotallyrandom
|
||||
volumes:
|
||||
- config:/etc/rancher/k3s
|
||||
tmpfs:
|
||||
- /run
|
||||
- /var/run
|
||||
privileged: true
|
||||
|
||||
node:
|
||||
image: rancher/k3s:v0.1.0-rc8
|
||||
tmpfs:
|
||||
- /run
|
||||
- /var/run
|
||||
privileged: true
|
||||
environment:
|
||||
- K3S_URL=https://server:6443
|
||||
- K3S_CLUSTER_SECRET=somethingtotallyrandom
|
||||
|
||||
sonobuoy:
|
||||
build: .
|
||||
volumes:
|
||||
- config:/etc/rancher/k3s
|
||||
|
||||
volumes:
|
||||
config: {}
|
||||
16
e2e/run-test.sh
Executable file
16
e2e/run-test.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
set -e -x
|
||||
|
||||
while [ ! -e /etc/rancher/k3s/k3s.yaml ]; do
|
||||
echo waiting for config
|
||||
sleep 1
|
||||
done
|
||||
|
||||
mkdir -p /root/.kube
|
||||
sed 's/localhost/server/g' /etc/rancher/k3s/k3s.yaml > /root/.kube/config
|
||||
export KUBECONFIG=/root/.kube/config
|
||||
cat /etc/rancher/k3s/k3s.yaml
|
||||
cat $KUBECONFIG
|
||||
sonobuoy run
|
||||
sleep 15
|
||||
sonobuoy logs -f
|
||||
Loading…
Reference in a new issue