mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
Fix the expect script to take an argument rather than extract bits from the environment. Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
21 lines
381 B
Plaintext
21 lines
381 B
Plaintext
#!/usr/bin/expect -f
|
|
|
|
set timeout 20
|
|
|
|
if { $argc < 1 } {
|
|
error "missing snap-mount-dir"
|
|
}
|
|
set snapMountDir [lindex $argv 0]
|
|
|
|
spawn bash
|
|
|
|
# Test private /tmp, allowed access
|
|
spawn su -l -c "${snapMountDir}/bin/test-snapd-sh.sh" test
|
|
expect "$" {} timeout { exit 1 }
|
|
send "touch /tmp/foo\n"
|
|
send "stat /tmp/foo\n"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"File: '/tmp/foo'*Size: 0"
|
|
}
|