From 18a4af4f770ab100e3e755647d38b04d68357082 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 14 Feb 2023 16:11:39 -0500 Subject: testing --name --- test/utils/join2.exp | 42 ---------------------------- test/utils/join3.exp | 42 ---------------------------- test/utils/name.exp | 77 ++++++++++++++++++++++++++++++++++++---------------- test/utils/utils.sh | 6 ---- 4 files changed, 53 insertions(+), 114 deletions(-) delete mode 100755 test/utils/join2.exp delete mode 100755 test/utils/join3.exp (limited to 'test/utils') diff --git a/test/utils/join2.exp b/test/utils/join2.exp deleted file mode 100755 index 5f5a6bfe0..000000000 --- a/test/utils/join2.exp +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2022 Firejail Authors -# License GPL v2 - -set timeout 10 -cd /home -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=\"join testing\"\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 2 - -spawn $env(SHELL) -send -- "firejail --join=\"join testing\"\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "Switching to pid" -} -expect { - timeout {puts "TESTING ERROR 2\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 1 -send -- "ps aux\r" -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "/bin/bash" -} -expect { - timeout {puts "TESTING ERROR 4\n";exit} - "/bin/bash" -} - -send -- "exit\r" -after 100 - -puts "\nall done\n" diff --git a/test/utils/join3.exp b/test/utils/join3.exp deleted file mode 100755 index c771b924b..000000000 --- a/test/utils/join3.exp +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2022 Firejail Authors -# License GPL v2 - -set timeout 10 -cd /home -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=join\\ testing\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 2 - -spawn $env(SHELL) -send -- "firejail --join=join\\ testing\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "Switching to pid" -} -expect { - timeout {puts "TESTING ERROR 2\n";exit} - -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" -} -sleep 1 -send -- "ps aux\r" -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "/bin/bash" -} -expect { - timeout {puts "TESTING ERROR 4\n";exit} - "/bin/bash" -} - -send -- "exit\r" -after 100 - -puts "\nall done\n" diff --git a/test/utils/name.exp b/test/utils/name.exp index cd4465d41..4c317216c 100755 --- a/test/utils/name.exp +++ b/test/utils/name.exp @@ -7,10 +7,39 @@ set timeout 10 spawn $env(SHELL) match_max 100000 +send -- "firejail --name=12345\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "invalid sandbox name" +} +after 100 + +send -- "firejail --name=\"join testing\"\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "invalid sandbox name" +} +after 100 + + +send -- "firejail --name=join\\ testing\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "invalid sandbox name" +} +after 100 + +send -- "firejail --name=asdf,12345\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "invalid sandbox name" +} +after 100 + send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 0\n";exit} + timeout {puts "TESTING ERROR 5\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -18,7 +47,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 1\n";exit} + timeout {puts "TESTING ERROR 6\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -26,7 +55,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 2\n";exit} + timeout {puts "TESTING ERROR 7\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -34,7 +63,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 3\n";exit} + timeout {puts "TESTING ERROR 8\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -42,7 +71,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 4\n";exit} + timeout {puts "TESTING ERROR 9\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -50,7 +79,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 5\n";exit} + timeout {puts "TESTING ERROR 10\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -58,7 +87,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 6\n";exit} + timeout {puts "TESTING ERROR 11\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -66,7 +95,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 7\n";exit} + timeout {puts "TESTING ERROR 12\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -74,7 +103,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 8\n";exit} + timeout {puts "TESTING ERROR 13\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -82,7 +111,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 9\n";exit} + timeout {puts "TESTING ERROR 14\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -90,7 +119,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 10\n";exit} + timeout {puts "TESTING ERROR 15\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -98,7 +127,7 @@ after 100 spawn $env(SHELL) send -- "firejail --name=ftest\r" expect { - timeout {puts "TESTING ERROR 11\n";exit} + timeout {puts "TESTING ERROR 16\n";exit} -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" } after 100 @@ -106,51 +135,51 @@ after 100 spawn $env(SHELL) send -- "firejail --list\r" expect { - timeout {puts "TESTING ERROR 12\n";exit} + timeout {puts "TESTING ERROR 17\n";exit} ":ftest:" } expect { - timeout {puts "TESTING ERROR 13\n";exit} + timeout {puts "TESTING ERROR 18\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 14\n";exit} + timeout {puts "TESTING ERROR 19\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 15\n";exit} + timeout {puts "TESTING ERROR 20\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 16\n";exit} + timeout {puts "TESTING ERROR 21\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 17\n";exit} + timeout {puts "TESTING ERROR 22\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 18\n";exit} + timeout {puts "TESTING ERROR 23\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 19\n";exit} + timeout {puts "TESTING ERROR 24\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 20\n";exit} + timeout {puts "TESTING ERROR 25\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 21\n";exit} + timeout {puts "TESTING ERROR 26\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 22\n";exit} + timeout {puts "TESTING ERROR 27\n";exit} ":ftest-" } expect { - timeout {puts "TESTING ERROR 23\n";exit} + timeout {puts "TESTING ERROR 28\n";exit} ":ftest-" } sleep 1 diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 647cbfb34..35c292832 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -85,12 +85,6 @@ echo "TESTING: shutdown4 (test/utils/shutdown4.exp)" echo "TESTING: join (test/utils/join.exp)" ./join.exp -echo "TESTING: join2 (test/utils/join2.exp)" -./join2.exp - -echo "TESTING: join3 (test/utils/join3.exp)" -./join3.exp - echo "TESTING: join4 (test/utils/join4.exp)" ./join4.exp -- cgit v1.2.3-54-g00ecf