From b54bc589bbaa3b158cad2e23a4e32158b1622e51 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 21 Oct 2018 11:58:58 -0400 Subject: apparmor test --- test/filters/apparmor.exp | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 test/filters/apparmor.exp (limited to 'test/filters/apparmor.exp') diff --git a/test/filters/apparmor.exp b/test/filters/apparmor.exp new file mode 100755 index 000000000..acc42a117 --- /dev/null +++ b/test/filters/apparmor.exp @@ -0,0 +1,59 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2018 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --name=test1 --apparmor\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --name=test2 --apparmor\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firemon --apparmor\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "test1:firejail --name=test1 --apparmor" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "AppArmor: firejail-default enforce" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "test2:firejail --name=test2 --apparmor" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "AppArmor: firejail-default enforce" +} +after 100 + +send -- "firejail --apparmor.print=test1\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "AppArmor: firejail-default enforce" +} +after 100 + +send -- "firejail --apparmor.print=test2\r" +expect { + timeout {puts "TESTING ERROR 7\n";exit} + "AppArmor: firejail-default enforce" +} +after 100 + +puts "\nall done\n" -- cgit v1.2.3-54-g00ecf