File: tmp-create.exp

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (20 lines) | stat: -rw-r--r-- 381 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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"
}