From fc116c063938d5e141d5fbc38e8013d9832ef315 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 15 Sep 2016 09:59:11 -0400 Subject: testing --- test/root/seccomp-chmod.exp | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 test/root/seccomp-chmod.exp (limited to 'test/root/seccomp-chmod.exp') diff --git a/test/root/seccomp-chmod.exp b/test/root/seccomp-chmod.exp new file mode 100755 index 000000000..b17990e3a --- /dev/null +++ b/test/root/seccomp-chmod.exp @@ -0,0 +1,51 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2016 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --seccomp=chmod,fchmod,fchmodat --private\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 2 + +send -- "cd ~; echo done\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "done" +} + +send -- "touch testfile; echo done\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "done" +} + +send -- "ls -l testfile; echo done\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "testfile" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "done" +} + +send -- "chmod +x testfile; echo done\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Bad system call" +} +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "done" +} + +send -- "exit\r" +after 100 +puts "\nall done\n" -- cgit v1.2.3-54-g00ecf