-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ian Campbell <[email protected]>
- Loading branch information
Ian Campbell
committed
Dec 8, 2017
1 parent
9740eec
commit 14811e6
Showing
2 changed files
with
131 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env expect | ||
|
||
# medium circle CI has 4G of RAM, use 3.5G for VM | ||
spawn env {KUBE_RUN_ARGS=-publish 2222:22} KUBE_MEM=3584 KUBE_DISK=8G KUBE_CLEAR_STATE=y KUBE_MASTER_UNTAINT=y ./boot.sh | ||
set lk_id $spawn_id | ||
set lk_pid [exp_pid -i $lk_id] | ||
set timeout 60 | ||
|
||
set console_prompt "(ns: getty) linuxkit-*:*# " | ||
set ssh_prompt "linuxkit-*:*# " | ||
|
||
expect { | ||
$console_prompt { | ||
puts "SUCCESS boot" | ||
} timeout { | ||
puts "FAIL boot (timeout)" | ||
exec kill -9 $lk_pid | ||
exit 1 | ||
} | ||
} | ||
|
||
# Getty service may start before sshd one is up and running, ConnectionAttempts=10 below doesn't seem affective, so give it a chance here. | ||
sleep 3 | ||
|
||
spawn env {SSHOPTS=-p 2222 -o ConnectionAttempts=10 -o LogLevel=DEBUG} ./ssh_into_kubelet.sh localhost | ||
set ssh_id $spawn_id | ||
set ssh_pid [exp_pid -i $ssh_id] | ||
set timeout 20 | ||
|
||
expect { | ||
$ssh_prompt { | ||
puts "RUN kubeadm-init.sh" | ||
send "kubeadm-init.sh\n" | ||
} timeout { | ||
puts "FAIL ssh (timeout)" | ||
exec kill -9 $lk_pid $ssh_pid | ||
exit 1 | ||
} | ||
} | ||
|
||
expect { | ||
$ssh_prompt { | ||
puts "RUN poweroff -f" | ||
send "poweroff -f\n" | ||
} -timeout 120 timeout { | ||
puts "FAIL kubeadm-init.sh (timeout)" | ||
exec kill -9 $lk_pid $ssh_pid | ||
exit 1 | ||
} | ||
} | ||
|
||
expect { | ||
"Power down" { | ||
puts "SUCCESS poweroff" | ||
} eof { | ||
puts "SUCCESS poweroff" | ||
} timeout { | ||
puts "FAILED poweroff (timeout)" | ||
exec kill -9 $lk_pid $ssh_pid | ||
exit 1 | ||
} | ||
} |