From 2bd593cbeb17f109f8f53c811671fa8166411421 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 30 Apr 2016 12:19:53 -0400 Subject: make test-filters fixes --- test/filters/filters.sh | 13 +++++-------- test/filters/seccomp-chmod-profile.exp | 30 ++++++++++++++++-------------- test/filters/seccomp-chmod.exp | 30 ++++++++++++++++-------------- 3 files changed, 37 insertions(+), 36 deletions(-) (limited to 'test/filters') diff --git a/test/filters/filters.sh b/test/filters/filters.sh index 11d90b011..1e64a6373 100755 --- a/test/filters/filters.sh +++ b/test/filters/filters.sh @@ -27,20 +27,17 @@ echo "TESTING: seccomp errno (test/filters/seccomp-errno.exp)" echo "TESTING: seccomp su (test/filters/seccomp-su.exp)" ./seccomp-su.exp -echo "TESTING: seccomp ptrace (seccomp-ptrace.exp)" +echo "TESTING: seccomp ptrace (test/filters/seccomp-ptrace.exp)" ./seccomp-ptrace.exp -# todo: fix pwd -#echo "TESTING: seccomp chmod - seccomp lists (test/filters/seccomp-chmod.exp)" -#./seccomp-chmod.exp +echo "TESTING: seccomp chmod - seccomp lists (test/filters/seccomp-chmod.exp)" +./seccomp-chmod.exp -# todo: fix pwd -#echo "TESTING: seccomp chmod profile - seccomp lists (test/filters/seccomp-chmod-profile.exp)" -#./seccomp-chmod-profile.exp +echo "TESTING: seccomp chmod profile - seccomp lists (test/filters/seccomp-chmod-profile.exp)" +./seccomp-chmod-profile.exp # todo: fix pwd and add seccomp-chown.exp and seccomp-umount.exp - echo "TESTING: seccomp empty (test/filters/seccomp-empty.exp)" ./seccomp-empty.exp diff --git a/test/filters/seccomp-chmod-profile.exp b/test/filters/seccomp-chmod-profile.exp index 9683fad90..e5d16f524 100755 --- a/test/filters/seccomp-chmod-profile.exp +++ b/test/filters/seccomp-chmod-profile.exp @@ -14,36 +14,38 @@ expect { } sleep 2 -send -- "touch testfile;pwd\r" +send -- "cd ~; echo done\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - "/root" {puts "running as root"} - "/home" + "done" } -send -- "ls -l testfile;pwd\r" +send -- "touch testfile; echo done\r" expect { timeout {puts "TESTING ERROR 2\n";exit} - "testfile" + "done" } + +send -- "ls -l testfile; echo done\r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "/root" {puts "running as root"} - "/home" + "testfile" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "done" } -send -- "chmod +x testfile;pwd\r" +send -- "chmod +x testfile; echo done\r" expect { - timeout {puts "TESTING ERROR 2\n";exit} + timeout {puts "TESTING ERROR 5\n";exit} "Bad system call" } expect { - timeout {puts "TESTING ERROR 3\n";exit} - "/root" {puts "running as root"} - "/home" + timeout {puts "TESTING ERROR 6\n";exit} + "done" } - send -- "exit\r" sleep 1 -puts "\n" +puts "\nall done\n" diff --git a/test/filters/seccomp-chmod.exp b/test/filters/seccomp-chmod.exp index 0d52122d3..9ca084e7f 100755 --- a/test/filters/seccomp-chmod.exp +++ b/test/filters/seccomp-chmod.exp @@ -14,36 +14,38 @@ expect { } sleep 2 -send -- "touch testfile;pwd\r" +send -- "cd ~; echo done\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - "/root" {puts "running as root"} - "/home" + "done" } -send -- "ls -l testfile;pwd\r" +send -- "touch testfile; echo done\r" expect { timeout {puts "TESTING ERROR 2\n";exit} - "testfile" + "done" } + +send -- "ls -l testfile; echo done\r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "/root" {puts "running as root"} - "/home" + "testfile" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "done" } -send -- "chmod +x testfile;pwd\r" +send -- "chmod +x testfile; echo done\r" expect { - timeout {puts "TESTING ERROR 2\n";exit} + timeout {puts "TESTING ERROR 5\n";exit} "Bad system call" } expect { - timeout {puts "TESTING ERROR 3\n";exit} - "/root" {puts "running as root"} - "/home" + timeout {puts "TESTING ERROR 6\n";exit} + "done" } - send -- "exit\r" sleep 1 -puts "\n" +puts "\nall done\n" -- cgit v1.2.3-54-g00ecf