From 27c4d069f322fbeca07c88e0e96208233103a5db Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 28 Feb 2023 09:51:26 -0500 Subject: chroot testing --- test/features/3.4.exp | 208 -------------------------------------------------- 1 file changed, 208 deletions(-) delete mode 100755 test/features/3.4.exp (limited to 'test/features/3.4.exp') diff --git a/test/features/3.4.exp b/test/features/3.4.exp deleted file mode 100755 index 813c2d86a..000000000 --- a/test/features/3.4.exp +++ /dev/null @@ -1,208 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2023 Firejail Authors -# License GPL v2 -# -# whitelist home -# - -set timeout 10 -spawn $env(SHELL) -match_max 100000 -set overlay [lindex $argv 0] -set chroot [lindex $argv 1] - -# -# N -# -send -- "firejail --noprofile --whitelist=/home/netblue/.config\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 1 - -send -- "ls -al | wc -l\r" -expect { - timeout {puts "TESTING ERROR 1.1\n";exit} - "6" -} - -send -- "ls -al .bashrc\r" -expect { - timeout {puts "TESTING ERROR 1.2\n";exit} - "netblue" -} -expect { - timeout {puts "TESTING ERROR 1.3\n";exit} - "netblue" -} -expect { - timeout {puts "TESTING ERROR 1.4\n";exit} - ".bashrc" -} - -send -- "ls -al .Xauthority\r" -expect { - timeout {puts "TESTING ERROR 1.5\n";exit} - "netblue" -} -expect { - timeout {puts "TESTING ERROR 1.6\n";exit} - "netblue" -} -expect { - timeout {puts "TESTING ERROR 1.7\n";exit} - ".Xauthority" -} - -send -- "ls -al | grep .config\r" -expect { - timeout {puts "TESTING ERROR 1.8\n";exit} - "netblue" -} -expect { - timeout {puts "TESTING ERROR 1.9\n";exit} - "netblue" -} -expect { - timeout {puts "TESTING ERROR 1.10\n";exit} - ".config" -} - -after 100 -send -- "exit\r" -sleep 1 - - -# -# O -# -if { $overlay == "overlay" } { - send -- "firejail --noprofile --overlay --whitelist=/home/netblue/.config\r" - expect { - timeout {puts "TESTING ERROR 2\n";exit} - "overlay option is not available" {puts "grsecurity\n"; exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"} - } - sleep 1 - - send -- "ls -al | wc -l\r" - expect { - timeout {puts "TESTING ERROR 3.1\n";exit} - "6" - } - - send -- "ls -al .bashrc\r" - expect { - timeout {puts "TESTING ERROR 3.2\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 3.3\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 3.4\n";exit} - ".bashrc" - } - - send -- "ls -al .Xauthority\r" - expect { - timeout {puts "TESTING ERROR 3.5\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 3.6\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 3.7\n";exit} - ".Xauthority" - } - - send -- "ls -al | grep .config\r" - expect { - timeout {puts "TESTING ERROR 3.8\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 3.9\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 3.10\n";exit} - ".config" - } - - after 100 - send -- "exit\r" - sleep 1 -} - -# -# C -# -if { $chroot == "chroot" } { - send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/home/netblue/.config\r" - expect { - timeout {puts "TESTING ERROR 4\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" - } - sleep 1 - - send -- "ls -al | wc -l\r" - expect { - timeout {puts "TESTING ERROR 5.1\n";exit} - "6" - } - - send -- "ls -al .bashrc\r" - expect { - timeout {puts "TESTING ERROR 5.2\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 5.3\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 5.4\n";exit} - ".bashrc" - } - - send -- "ls -al .Xauthority\r" - expect { - timeout {puts "TESTING ERROR 5.5\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 5.6\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 5.7\n";exit} - ".Xauthority" - } - - send -- "ls -al | grep .config\r" - expect { - timeout {puts "TESTING ERROR 5.8\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 5.9\n";exit} - "netblue" - } - expect { - timeout {puts "TESTING ERROR 5.10\n";exit} - ".config" - } - - after 100 - send -- "exit\r" - sleep 1 -} - - -puts "\nall done\n" -- cgit v1.2.3-70-g09d2