Files
linuxkit/test/cases/040_packages/007_getty-containerd/test.exp
Ian Campbell b3db1a887c Update to containerd v1.0.0-alpha1
This is actually containerd#1141 rebased onto v1.0.0-alpha1.

The `dist` command has been integreated into `ctr` and so is removed, including
from the getty and sshd bind mounts and the test which uses it is updated..

There is no change to the version of runc vendored by containerd, so this is
unchanged.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-07-20 14:10:51 +01:00

100 lines
1.6 KiB
Plaintext
Executable File

#!/usr/bin/env expect
spawn linuxkit run test-ctr
set pid [exp_pid]
set timeout 60
set prompt ":~# "
# Running $image should produce $output
set image "docker.io/library/hello-world@sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f"
set output "Hello from Docker!"
expect {
timeout {
puts "FAILED boot"
exec kill -9 $pid
exit 1
}
"Welcome to LinuxKit" {
puts "SUCCESS boot"
}
}
expect {
timeout {
puts "FAILED login user"
exec kill -9 $pid
exit 1
}
"ogin: " {
send "root\n"
}
}
expect {
timeout {
puts "FAILED login pass"
exec kill -9 $pid
exit 1
}
"assword: " {
send "abcdefgh\n"
}
}
expect {
timeout {
puts "FAILED ctr pull"
exec kill -9 $pid
exit 1
}
$prompt {
send "ctr pull $image\n"
}
}
expect {
timeout {
puts "FAILED ctr pull"
exec kill -9 $pid
exit 1
}
$prompt {
puts "SUCCESS ctr pull"
send "ctr run -t $image test\n"
}
}
expect {
timeout {
puts "FAILED ctr run"
exec kill -9 $pid
exit 1
}
$output {
puts "SUCCESS ctr run"
# Ctrl-C
send "\003"
}
}
expect {
timeout {
puts "FAILED kill ctr"
exec kill -9 $pid
exit 1
}
$prompt {
send "poweroff -f\n"
}
}
expect {
timeout {
puts "FAILED poweroff"
exec kill -9 $pid
exit 1
}
"Power down" {
puts "SUCCESS poweroff"
}
eof {
puts "SUCCESS poweroff"
}
}
set waitval [wait -i $spawn_id]
set exval [lindex $waitval 3]
exit $exval