convert mount service to trigger
Good: this means it's not hanging holding the s6 dataase lock. Bad: it's the ugliest implementation and doesn't deserve to be preserved (tbf the ugliness is not new)
This commit is contained in:
47
tests/inout/script.expect
Normal file
47
tests/inout/script.expect
Normal file
@@ -0,0 +1,47 @@
|
||||
set timeout 10
|
||||
|
||||
proc chat {instr outstr} {
|
||||
expect {
|
||||
$instr { send $outstr }
|
||||
timeout { exit 1 }
|
||||
}
|
||||
}
|
||||
spawn socat -,echo=0,icanon=1 unix-connect:vm/monitor
|
||||
set monitor_id $spawn_id
|
||||
|
||||
# expect "(qemu)"
|
||||
# send "set_link virtio-net-pci.1 off\n"
|
||||
# expect "(qemu)"
|
||||
# send "set_link virtio-net-pci.0 off\n"
|
||||
# expect "(qemu)"
|
||||
# send "c\r\n"
|
||||
|
||||
spawn socat unix-connect:vm/console -
|
||||
set console_id $spawn_id
|
||||
|
||||
expect "BusyBox"
|
||||
chat "#" "PS1=RE\\ADY_\\ ; stty -echo \r"
|
||||
chat "READY_" "s6-rc -b -a list\r"
|
||||
|
||||
chat "watch-mount" "\r"
|
||||
|
||||
set spawn_id $monitor_id
|
||||
chat "QEMU" "device_add usb-storage,bus=xhci.0,drive=usbstick\n"
|
||||
chat "(qemu)" "version\r"
|
||||
|
||||
set spawn_id $console_id
|
||||
|
||||
expect {
|
||||
"mounted filesystem" { }
|
||||
timeout { exit 1 }
|
||||
}
|
||||
|
||||
|
||||
send "\r"
|
||||
chat "READY_" "s6-rc -b -a list\r"
|
||||
chat "READY_" "cat /proc/mounts\r"
|
||||
|
||||
expect {
|
||||
"/srv" { }
|
||||
timeout { exit 1 }
|
||||
}
|
Reference in New Issue
Block a user