From 2c55e7f15219504ea70a12274618e5ba8e5c35da Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 12 Sep 2020 07:56:25 -0400 Subject: some dbus tests --- test/utils/join5.exp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ test/utils/join5.profile | 4 ++++ test/utils/utils.sh | 5 ++++- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100755 test/utils/join5.exp create mode 100644 test/utils/join5.profile (limited to 'test/utils') diff --git a/test/utils/join5.exp b/test/utils/join5.exp new file mode 100755 index 000000000..43ca09b4d --- /dev/null +++ b/test/utils/join5.exp @@ -0,0 +1,46 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2020 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --name=test123 --profile=join5.profile\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Child process initialized" +} +sleep 1 +spawn $env(SHELL) +send -- "firejail --join=test123\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Switching to pid" +} +sleep 1 +send -- "ps aux\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "/bin/bash" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "/bin/bash" +} + +send -- "exit\r" +after 100 + +send -- "firejail --protocol.print=test123\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Switching to pid" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "unix" +} + +puts "\nall done\n" diff --git a/test/utils/join5.profile b/test/utils/join5.profile new file mode 100644 index 000000000..e9eb37a4f --- /dev/null +++ b/test/utils/join5.profile @@ -0,0 +1,4 @@ +dbus-user filter +dbus-system none +seccomp +protocol unix diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 48a8051fa..7e8426f35 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -99,9 +99,12 @@ echo "TESTING: join2 (test/utils/join2.exp)" echo "TESTING: join3 (test/utils/join3.exp)" ./join3.exp -echo "TESTING: join3 (test/utils/join4.exp)" +echo "TESTING: join4 (test/utils/join4.exp)" ./join4.exp +echo "TESTING: join5 (test/utils/join5.exp)" +./join5.exp + echo "TESTING: join profile (test/utils/join-profile.exp)" ./join-profile.exp -- cgit v1.2.3-54-g00ecf