From fffce11c3da087172c069ec0ff4c788f5bcc522b Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 10 Nov 2016 20:15:22 -0500 Subject: testing --- test/root/firemon-events.exp | 72 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 test/root/firemon-events.exp (limited to 'test/root/firemon-events.exp') diff --git a/test/root/firemon-events.exp b/test/root/firemon-events.exp new file mode 100755 index 000000000..4f305e51d --- /dev/null +++ b/test/root/firemon-events.exp @@ -0,0 +1,72 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +# start firemon +set firemon_id $spawn_id +send -- "firemon\r" +sleep 1 + +# start firejail +spawn $env(SHELL) +set firejail_id $spawn_id +send -- "firejail\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} + +# get messages on firemon +set spawn_id $firemon_id +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "exec" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "/bin/bash -c /bin/bash" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "exec" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "/bin/bash" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "fork" +} +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "child" +} +expect { + timeout {puts "TESTING ERROR 7\n";exit} + "/bin/bash" +} +after 100 + +# exit firejail +set spawn_id $firejail_id +send -- "exit\r" +sleep 1 + +# get messages on firemon +set spawn_id $firemon_id +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "exit" +} + +expect { + timeout {puts "TESTING ERROR 9\n";exit} + "EXIT SANDBOX" +} + + +puts "\nall done\n" + -- cgit v1.2.3-54-g00ecf