Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2853 from weaveworks/kube-smoketest-1.6
Browse files Browse the repository at this point in the history
Update smoke tests for kubernetes 1.6
  • Loading branch information
marccarre committed Apr 10, 2017
2 parents fa08bb9 + 74a7bef commit 77b1937
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DOCKER_VERSION=1.11.2
KUBERNETES_VERSION=1.5.2
KUBERNETES_CNI_VERSION=0.3.0.1
KUBERNETES_VERSION=1.6.1
KUBERNETES_CNI_VERSION=0.5.1
19 changes: 9 additions & 10 deletions test/840_weave_kube_3_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@

tear_down_kubeadm() {
for host in $HOSTS; do
# If we don't stop kubelet, it will restart all the containers we're trying to kill
run_on $host "sudo systemctl stop kubelet"
rm_containers $host $(docker_on $host ps -aq)
run_on $host "test ! -d /var/lib/kubelet || sudo find /var/lib/kubelet -execdir findmnt -n -t tmpfs -o TARGET -T {} \; | uniq | xargs -r sudo umount"
run_on $host "sudo rm -r -f /etc/kubernetes /var/lib/kubelet /var/lib/etcd /etc/cni /opt/cni/bin/*weave*"
run_on $host "sudo kubeadm reset && sudo rm -r -f /opt/cni/bin/*weave*"
done
}

howmany() { echo $#; }

start_suite "Test weave-kube image with Kubernetes"

TOKEN=112233.445566778899000
TOKEN=112233.4455667788990000
HOST1IP=$($SSH $HOST1 "getent hosts $HOST1 | cut -f 1 -d ' '")
NUM_HOSTS=$(howmany $HOSTS)
SUCCESS="$(( $NUM_HOSTS * ($NUM_HOSTS-1) )) established"
KUBECTL="sudo kubectl --kubeconfig /etc/kubernetes/admin.conf"
KUBE_PORT=6443

tear_down_kubeadm

Expand All @@ -35,13 +33,14 @@ for host in $HOSTS; do
if [ $host = $HOST1 ] ; then
run_on $host "sudo systemctl start kubelet && sudo kubeadm init --$k8s_version_option=$k8s_version --token=$TOKEN"
else
run_on $host "sudo systemctl start kubelet && sudo kubeadm join --token=$TOKEN $HOST1IP"
run_on $host "sudo systemctl start kubelet && sudo kubeadm join --token=$TOKEN $HOST1IP:$KUBE_PORT"
fi
done

[ -n "$COVERAGE" ] && COVERAGE_ARGS="\\n env:\\n - name: EXTRA_ARGS\\n value: \"-test.coverprofile=/home/weave/cover.prof --\""

sed -e "s%imagePullPolicy: Always%imagePullPolicy: Never$COVERAGE_ARGS%" "$(dirname "$0")/../prog/weave-kube/weave-daemonset.yaml" | run_on $HOST1 "kubectl apply -f -"
sed -e "s%imagePullPolicy: Always%imagePullPolicy: Never$COVERAGE_ARGS%" "$(dirname "$0")/../prog/weave-kube/weave-daemonset-k8s-1.6.yaml" \
| run_on $HOST1 "$KUBECTL apply -f -"

sleep 5

Expand Down Expand Up @@ -73,11 +72,11 @@ assert "run_on $HOST2 ps aux | grep -c '[d]efunct'" "0"
assert "run_on $HOST3 ps aux | grep -c '[d]efunct'" "0"

# See if we can get some pods running that connect to the network
run_on $HOST1 "kubectl run hello --image=weaveworks/hello-world --replicas=3"
run_on $HOST1 "$KUBECTL run hello --image=weaveworks/hello-world --replicas=3"

wait_for_pods() {
for i in $(seq 1 45); do
if run_on $HOST1 "kubectl get pods | grep 'hello.*Running'" ; then
if run_on $HOST1 "$KUBECTL get pods | grep 'hello.*Running'" ; then
return
fi
echo "Waiting for pods"
Expand Down

0 comments on commit 77b1937

Please sign in to comment.