From 9f5c42b2e729047f911e928885c8b7b2d0238ceb Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 12 Jan 2023 13:12:10 -0500 Subject: fix make test-filters --- test/filters/apparmor.exp | 8 ++--- test/filters/protocol.exp | 73 ++++++++++++++++++++++++++++++++------ test/filters/seccomp-run-files.exp | 4 +-- 3 files changed, 69 insertions(+), 16 deletions(-) (limited to 'test') diff --git a/test/filters/apparmor.exp b/test/filters/apparmor.exp index 13ce4dd06..0797a1db3 100755 --- a/test/filters/apparmor.exp +++ b/test/filters/apparmor.exp @@ -30,7 +30,7 @@ expect { } expect { timeout {puts "TESTING ERROR 3\n";exit} - "AppArmor: firejail-default enforce" + "AppArmor: firejail-default//&unconfined enforce" } expect { timeout {puts "TESTING ERROR 4\n";exit} @@ -38,21 +38,21 @@ expect { } expect { timeout {puts "TESTING ERROR 5\n";exit} - "AppArmor: firejail-default enforce" + "AppArmor: firejail-default//&unconfined enforce" } after 100 send -- "firejail --apparmor.print=test1\r" expect { timeout {puts "TESTING ERROR 6\n";exit} - "AppArmor: firejail-default enforce" + "AppArmor: firejail-default//&unconfined enforce" } after 100 send -- "firejail --apparmor.print=test2\r" expect { timeout {puts "TESTING ERROR 7\n";exit} - "AppArmor: firejail-default enforce" + "AppArmor: firejail-default//&unconfined enforce" } after 100 diff --git a/test/filters/protocol.exp b/test/filters/protocol.exp index cbc7fdc1a..96ac8d586 100755 --- a/test/filters/protocol.exp +++ b/test/filters/protocol.exp @@ -10,35 +10,88 @@ match_max 100000 send -- "firejail --noprofile --protocol=unix --debug\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - "0009: 20 00 00 00000000 ld data.syscall-number" + "0009: 20 00 00 00000000" } expect { timeout {puts "TESTING ERROR 2\n";exit} - "000a: 15 01 00 00000029 jeq socket 000c (false 000b)" + "000f: 20 00 00 00000010" } expect { timeout {puts "TESTING ERROR 3\n";exit} - "000b: 06 00 00 7fff0000 ret ALLOW" + "0010: 15 00 01 00000001" } expect { timeout {puts "TESTING ERROR 4\n";exit} - "000c: 20 00 00 00000010 ld data.args" + "0011: 06 00 00 7fff0000" } expect { timeout {puts "TESTING ERROR 5\n";exit} - "000d: 15 00 01 00000001 jeq 1 000e (false 000f)" + "0012: 06 00 00 0005005f" +} + +after 100 +send -- "exit\r" +sleep 1 + +send -- "firejail --noprofile --protocol=bluetooth --debug\r" +expect { + timeout {puts "TESTING ERROR 11\n";exit} + "0009: 20 00 00 00000000" +} +expect { + timeout {puts "TESTING ERROR 12\n";exit} + "000f: 20 00 00 00000010" +} +expect { + timeout {puts "TESTING ERROR 13\n";exit} + "0010: 15 00 01 0000001f" +} +expect { + timeout {puts "TESTING ERROR 14\n";exit} + "0011: 06 00 00 7fff0000" +} +expect { + timeout {puts "TESTING ERROR1 5\n";exit} + "0012: 06 00 00 0005005f" +} + +after 100 +send -- "exit\r" +sleep 1 + +send -- "firejail --noprofile --protocol=inet,inet6 --debug\r" +expect { + timeout {puts "TESTING ERROR 31\n";exit} + "0009: 20 00 00 00000000" +} +expect { + timeout {puts "TESTING ERROR 32\n";exit} + "000f: 20 00 00 00000010" } expect { - timeout {puts "TESTING ERROR 6\n";exit} - "000e: 06 00 00 7fff0000 ret ALLOW" - "" + timeout {puts "TESTING ERROR 33\n";exit} + "0010: 15 00 01 00000002" } expect { - timeout {puts "TESTING ERROR 7\n";exit} - "000f: 06 00 00 0005005f ret ERRNO(95)" + timeout {puts "TESTING ERROR 34\n";exit} + "0011: 06 00 00 7fff0000" +} +expect { + timeout {puts "TESTING ERROR1 35\n";exit} + "0012: 15 00 01 0000000a" +} +expect { + timeout {puts "TESTING ERROR 36\n";exit} + "0013: 06 00 00 7fff0000" +} +expect { + timeout {puts "TESTING ERROR 37\n";exit} + "0014: 06 00 00 0005005f" } after 100 send -- "exit\r" + + after 100 puts "\nall done\n" diff --git a/test/filters/seccomp-run-files.exp b/test/filters/seccomp-run-files.exp index 59a576c20..95258ad4a 100755 --- a/test/filters/seccomp-run-files.exp +++ b/test/filters/seccomp-run-files.exp @@ -24,7 +24,7 @@ after 100 send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "6" + "8" } send -- "exit\r" sleep 1 @@ -90,7 +90,7 @@ after 100 send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r" expect { timeout {puts "TESTING ERROR 18\n";exit} - "8" + "10" } send -- "exit\r" sleep 1 -- cgit v1.2.3-54-g00ecf