From a989aac28eb0c28d09aa3ee72d9d67e168686f78 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 22 Nov 2015 15:14:13 -0500 Subject: feature testing --- test/features/1.10.exp | 69 ++++++++++++++++++++++++++++++++ test/features/1.4.exp | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100755 test/features/1.10.exp create mode 100755 test/features/1.4.exp (limited to 'test') diff --git a/test/features/1.10.exp b/test/features/1.10.exp new file mode 100755 index 000000000..a6e0f9281 --- /dev/null +++ b/test/features/1.10.exp @@ -0,0 +1,69 @@ +#!/usr/bin/expect -f +# +# disable /selinux +# + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +# +# N +# +send -- "firejail --noprofile\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -l /selinux\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Permission denied" +} +after 100 +send -- "exit\r" +sleep 1 + + +# +# O +# +send -- "firejail --noprofile --overlay\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -l /selinux\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Permission denied" +} +after 100 +send -- "exit\r" +sleep 1 + +# +# C +# +send -- "firejail --noprofile --chroot=/tmp/chroot\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -l /selinux\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Permission denied" +} +after 100 +send -- "exit\r" +sleep 1 + + +puts "\nall done\n" diff --git a/test/features/1.4.exp b/test/features/1.4.exp new file mode 100755 index 000000000..82d683175 --- /dev/null +++ b/test/features/1.4.exp @@ -0,0 +1,106 @@ +#!/usr/bin/expect -f +# +# mask other users +# + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +# +# N +# +send -- "firejail --noprofile\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -l /home | wc -l\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "2" +} +after 100 +send -- "cat /etc/passwd | grep 1001 | wc -l\r" +expect { + timeout {puts "TESTING ERROR 1.1\n";exit} + "0" +} +after 100 +send -- "cat /etc/group | grep 1001 | wc -l\r" +expect { + timeout {puts "TESTING ERROR 1.2\n";exit} + "0" +} +after 100 + +send -- "exit\r" +sleep 1 + + +# +# O +# +send -- "firejail --noprofile --overlay\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -l /home | wc -l\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "2" +} +after 100 +send -- "cat /etc/passwd | grep 1001 | wc -l\r" +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "0" +} +after 100 +send -- "cat /etc/group | grep 1001 | wc -l\r" +expect { + timeout {puts "TESTING ERROR 3.2\n";exit} + "0" +} +after 100 +send -- "exit\r" +sleep 1 + +# +# C +# +send -- "firejail --noprofile --chroot=/tmp/chroot\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -l /home | wc -l\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "2" +} +after 100 +send -- "cat /etc/passwd | grep 1001 | wc -l\r" +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "0" +} +after 100 +send -- "cat /etc/group | grep 1001 | wc -l\r" +expect { + timeout {puts "TESTING ERROR 5.2\n";exit} + "0" +} +after 100 +send -- "exit\r" +sleep 1 + + +puts "\nall done\n" -- cgit v1.2.3-54-g00ecf