From a3207cdca569d78ee6a9723c7c0dfdf10cd15845 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 24 Apr 2016 07:50:35 -0400 Subject: testing --- test/environment/environment.sh | 6 +++ test/environment/nice.exp | 83 +++++++++++++++++++++++++++++++++++++++++ test/environment/nice.profile | 1 + test/environment/sound.exp | 83 +++++++++++++++++++++++++++++++++++++++++ test/environment/sound.profile | 1 + test/nice.exp | 80 --------------------------------------- test/nice.profile | 1 - test/notes | 13 ------- test/sound.exp | 79 --------------------------------------- test/sound.profile | 1 - 10 files changed, 174 insertions(+), 174 deletions(-) create mode 100755 test/environment/nice.exp create mode 100644 test/environment/nice.profile create mode 100755 test/environment/sound.exp create mode 100644 test/environment/sound.profile delete mode 100755 test/nice.exp delete mode 100644 test/nice.profile delete mode 100644 test/notes delete mode 100755 test/sound.exp delete mode 100644 test/sound.profile (limited to 'test') diff --git a/test/environment/environment.sh b/test/environment/environment.sh index ef9b49d64..f737d284b 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh @@ -50,3 +50,9 @@ echo "TESTING: firejail in firejail - single sandbox (test/environment/firejail- echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)" ./firejail-in-firejail2.exp + +echo "TESTING: sound (test/environment/sound.exp)" +./sound.exp + +echo "TESTING: nice ((test/environment/nice.exp)" +./nice.exp diff --git a/test/environment/nice.exp b/test/environment/nice.exp new file mode 100755 index 000000000..7e5731c63 --- /dev/null +++ b/test/environment/nice.exp @@ -0,0 +1,83 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2016 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --nice=15\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "top -b -n 1\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "netblue" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "15" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "bash" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "netblu" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "15" +} +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "top" +} + +sleep 1 +send -- "exit\r" +sleep 1 + +send -- "firejail --profile=nice.profile\r" +expect { + timeout {puts "TESTING ERROR 10\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "top -b -n 1\r" +expect { + timeout {puts "TESTING ERROR 11\n";exit} + "netblue" +} +expect { + timeout {puts "TESTING ERROR 12\n";exit} + "15" +} +expect { + timeout {puts "TESTING ERROR 13\n";exit} + "bash" +} +expect { + timeout {puts "TESTING ERROR 14\n";exit} + "netblu" +} +expect { + timeout {puts "TESTING ERROR 15\n";exit} + "15" +} +expect { + timeout {puts "TESTING ERROR 16\n";exit} + "top" +} + + + +puts "\nall done\n" + diff --git a/test/environment/nice.profile b/test/environment/nice.profile new file mode 100644 index 000000000..d02c8f58b --- /dev/null +++ b/test/environment/nice.profile @@ -0,0 +1 @@ +nice 15 diff --git a/test/environment/sound.exp b/test/environment/sound.exp new file mode 100755 index 000000000..e2e8fb610 --- /dev/null +++ b/test/environment/sound.exp @@ -0,0 +1,83 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2016 Firejail Authors +# License GPL v2 + + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --nosound speaker-test\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Parent is shutting down" +} +sleep 2 + +send -- "firejail --nosound aplay -l\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Child process initialized" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "List of PLAYBACK" {puts "TESTING ERROR 3\n";exit} + "no soundcards found" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Parent is shutting down" +} +sleep 2 + + +send -- "firejail --profile=sound.profile speaker-test\r" +expect { + timeout {puts "TESTING ERROR 11\n";exit} + "Child process initialized" +} +expect { + timeout {puts "TESTING ERROR 12\n";exit} + "Parent is shutting down" +} +sleep 2 + +send -- "firejail --profile=sound.profile aplay -l\r" +expect { + timeout {puts "TESTING ERROR 13\n";exit} + "Child process initialized" +} +expect { + timeout {puts "TESTING ERROR 14\n";exit} + "List of PLAYBACK" {puts "TESTING ERROR 3\n";exit} + "no soundcards found" +} +expect { + timeout {puts "TESTING ERROR 15\n";exit} + "Parent is shutting down" +} +sleep 2 + + +send -- "firejail aplay -l\r" +expect { + timeout {puts "TESTING ERROR 23\n";exit} + "Child process initialized" +} +expect { + timeout {puts "TESTING ERROR 24\n";exit} + "List of PLAYBACK" +} +expect { + timeout {puts "TESTING ERROR 25\n";exit} + "Parent is shutting down" +} +sleep 2 + +puts "\nall done\n" + diff --git a/test/environment/sound.profile b/test/environment/sound.profile new file mode 100644 index 000000000..2f83a0bbb --- /dev/null +++ b/test/environment/sound.profile @@ -0,0 +1 @@ +nosound diff --git a/test/nice.exp b/test/nice.exp deleted file mode 100755 index f4afb547d..000000000 --- a/test/nice.exp +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/expect -f - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --nice=15\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Child process initialized" -} -sleep 1 - -send -- "top -b -n 1\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "netblue" -} -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "15" -} -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "bash" -} -expect { - timeout {puts "TESTING ERROR 4\n";exit} - "netblu" -} -expect { - timeout {puts "TESTING ERROR 5\n";exit} - "15" -} -expect { - timeout {puts "TESTING ERROR 6\n";exit} - "top" -} - -sleep 1 -send -- "exit\r" -sleep 1 - -send -- "firejail --profile=nice.profile\r" -expect { - timeout {puts "TESTING ERROR 10\n";exit} - "Child process initialized" -} -sleep 1 - -send -- "top -b -n 1\r" -expect { - timeout {puts "TESTING ERROR 11\n";exit} - "netblue" -} -expect { - timeout {puts "TESTING ERROR 12\n";exit} - "15" -} -expect { - timeout {puts "TESTING ERROR 13\n";exit} - "bash" -} -expect { - timeout {puts "TESTING ERROR 14\n";exit} - "netblu" -} -expect { - timeout {puts "TESTING ERROR 15\n";exit} - "15" -} -expect { - timeout {puts "TESTING ERROR 16\n";exit} - "top" -} - - - -puts "\nall done\n" - diff --git a/test/nice.profile b/test/nice.profile deleted file mode 100644 index d02c8f58b..000000000 --- a/test/nice.profile +++ /dev/null @@ -1 +0,0 @@ -nice 15 diff --git a/test/notes b/test/notes deleted file mode 100644 index 864cd5519..000000000 --- a/test/notes +++ /dev/null @@ -1,13 +0,0 @@ -Testing --nosound - -Get a list of active PulseAudio clients: -$ pacmd info | grep application.process.binary - application.process.binary = "lxpanel" - application.process.binary = "plugin-container" - application.process.binary = "plugin-container" - -Find active PulseAudio socket: -$ netstat -l | grep pulse -unix 2 [ ACC ] STREAM LISTENING 10669 /tmp/pulse-WwG6ohxIJmGO/cli -unix 2 [ ACC ] STREAM LISTENING 12584 /tmp/pulse-WwG6ohxIJmGO/dbus-socket -unix 2 [ ACC ] STREAM LISTENING 12581 /tmp/pulse-WwG6ohxIJmGO/native diff --git a/test/sound.exp b/test/sound.exp deleted file mode 100755 index 078f8b416..000000000 --- a/test/sound.exp +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/expect -f - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --nosound speaker-test\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "Child process initialized" -} -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "Parent is shutting down" -} -sleep 2 - -send -- "firejail --nosound aplay -l\r" -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "Child process initialized" -} -expect { - timeout {puts "TESTING ERROR 4\n";exit} - "List of PLAYBACK" {puts "TESTING ERROR 3\n";exit} - "no soundcards found" -} -expect { - timeout {puts "TESTING ERROR 5\n";exit} - "Parent is shutting down" -} -sleep 2 - - -send -- "firejail --profile=sound.profile speaker-test\r" -expect { - timeout {puts "TESTING ERROR 11\n";exit} - "Child process initialized" -} -expect { - timeout {puts "TESTING ERROR 12\n";exit} - "Parent is shutting down" -} -sleep 2 - -send -- "firejail --profile=sound.profile aplay -l\r" -expect { - timeout {puts "TESTING ERROR 13\n";exit} - "Child process initialized" -} -expect { - timeout {puts "TESTING ERROR 14\n";exit} - "List of PLAYBACK" {puts "TESTING ERROR 3\n";exit} - "no soundcards found" -} -expect { - timeout {puts "TESTING ERROR 15\n";exit} - "Parent is shutting down" -} -sleep 2 - - -send -- "firejail aplay -l\r" -expect { - timeout {puts "TESTING ERROR 23\n";exit} - "Child process initialized" -} -expect { - timeout {puts "TESTING ERROR 24\n";exit} - "List of PLAYBACK" -} -expect { - timeout {puts "TESTING ERROR 25\n";exit} - "Parent is shutting down" -} -sleep 2 - -puts "\n" - diff --git a/test/sound.profile b/test/sound.profile deleted file mode 100644 index 2f83a0bbb..000000000 --- a/test/sound.profile +++ /dev/null @@ -1 +0,0 @@ -nosound -- cgit v1.2.3-54-g00ecf