From ae1111abb8b8eee2a7605d3b535a16680dba3925 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Wed, 7 Sep 2016 10:23:07 -0400 Subject: testcase for read_pid fix --- test/utils/join4.exp | 38 ++++++++++++++++++++++++++++++++++++++ test/utils/utils.sh | 3 +++ 2 files changed, 41 insertions(+) create mode 100755 test/utils/join4.exp diff --git a/test/utils/join4.exp b/test/utils/join4.exp new file mode 100755 index 000000000..c367dd770 --- /dev/null +++ b/test/utils/join4.exp @@ -0,0 +1,38 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2016 Firejail Authors +# License GPL v2 + +set timeout 10 +cd /home +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --name=123test\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 2 + +spawn $env(SHELL) +send -- "firejail --join=123test\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" +after 100 + +puts "\nall done\n" diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 0428c4807..ff4e5e086 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -71,6 +71,9 @@ echo "TESTING: join2 (test/utils/join2.exp)" echo "TESTING: join3 (test/utils/join3.exp)" ./join3.exp +echo "TESTING: join3 (test/utils/join4.exp)" +./join4.exp + echo "TESTING: join profile (test/utils/join-profile.exp)" ./join-profile.exp -- cgit v1.2.3-54-g00ecf