From 3fa2d3ea26485f012b55b67449a5b4431e1c6318 Mon Sep 17 00:00:00 2001 From: smitsohu Date: Thu, 19 Nov 2020 16:15:53 +0100 Subject: tmpfs testing --- test/fs/fscheck-tmpfs.exp | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'test/fs') diff --git a/test/fs/fscheck-tmpfs.exp b/test/fs/fscheck-tmpfs.exp index ebd3eeb9c..d40b45ece 100755 --- a/test/fs/fscheck-tmpfs.exp +++ b/test/fs/fscheck-tmpfs.exp @@ -7,12 +7,49 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -# .. -send -- "firejail --tmpfs=fscheck-dir\r" +send -- "mkdir -p ~/fjtest-dir/fjtest-dir\r" +after 100 +send -- "mkdir -p /tmp/fjtest-dir/fjtest-dir\r" +after 100 + +if { ! [file exists ~/fjtest-dir/fjtest-dir] } { + puts "TESTING ERROR 1\n" + exit +} +if { ! [file exists /tmp/fjtest-dir/fjtest-dir] } { + puts "TESTING ERROR 2\n" + exit +} + +send -- "firejail --noprofile --tmpfs=~/fjtest-dir\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Child process initialized" +} +after 500 + +send -- "ls -l ~/fjtest-dir\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "total 0" +} +after 500 + +send -- "exit\r" +after 500 + +send -- "firejail --noprofile --tmpfs=/tmp/fjtest-dir\r" expect { - timeout {puts "TESTING ERROR 0.1\n";exit} + timeout {puts "TESTING ERROR 5\n";exit} "Error" } +after 500 + +# cleanup +send -- "rm -fr ~/fjtest-dir\r" after 100 +send -- "rm -fr /tmp/fjtest-dir\r" +after 100 + puts "\nall done\n" -- cgit v1.2.3-54-g00ecf