From 1df4bbba52854d2505bcd810e9e72b5e0980ebd3 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 10 Sep 2019 17:26:22 -0400 Subject: appimage --trace testing --- test/appimage/appimage-args.exp | 2 +- test/appimage/appimage-trace.exp | 68 ++++++++++++++++++++++++++++++++++++++++ test/appimage/appimage-v1.exp | 2 +- test/appimage/appimage-v2.exp | 2 +- test/appimage/appimage.sh | 3 ++ 5 files changed, 74 insertions(+), 3 deletions(-) create mode 100755 test/appimage/appimage-trace.exp (limited to 'test/appimage') diff --git a/test/appimage/appimage-args.exp b/test/appimage/appimage-args.exp index b8c7ee850..4c6a778b2 100755 --- a/test/appimage/appimage-args.exp +++ b/test/appimage/appimage-args.exp @@ -95,7 +95,7 @@ send -- "firejail --shutdown=appimage-test\r" set spawn_id $appimage_id expect { - timeout {puts "TESTING ERROR 15\n";exit} + timeout {puts "shutdown\n";exit} "AppImage unmounted" } diff --git a/test/appimage/appimage-trace.exp b/test/appimage/appimage-trace.exp new file mode 100755 index 000000000..574bd5a97 --- /dev/null +++ b/test/appimage/appimage-trace.exp @@ -0,0 +1,68 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2019 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 +set appimage_id $spawn_id + +send -- "firejail --trace --timeout=00:00:05 --appimage Leafpad-0.8.17-x86_64.AppImage\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "leafpad:socket" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "leafpad:connect" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "X11-unix/X0" +} +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Parent is shutting down, bye" +} +expect { + timeout {puts "shutdown\n"} + "AppImage unmounted" +} +sleep 1 + +send -- "firejail --trace --timeout=00:00:05 --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r" +expect { + timeout {puts "TESTING ERROR 11\n";exit} + "Child process initialized" +} +expect { + timeout {puts "TESTING ERROR 12\n";exit} + "leafpad:socket" +} +expect { + timeout {puts "TESTING ERROR 13\n";exit} + "leafpad:connect" +} +expect { + timeout {puts "TESTING ERROR 14\n";exit} + "X11-unix/X0" +} +expect { + timeout {puts "TESTING ERROR 15\n";exit} + "Parent is shutting down, bye" +} +expect { + timeout {puts "shutdown\n"} + "AppImage unmounted" +} +sleep 1 + + +after 100 + +puts "\nall done\n" diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp index 07f7d0d17..4522afa9b 100755 --- a/test/appimage/appimage-v1.exp +++ b/test/appimage/appimage-v1.exp @@ -83,7 +83,7 @@ send -- "firejail --shutdown=appimage-test\r" set spawn_id $appimage_id expect { - timeout {puts "TESTING ERROR 7\n";exit} + timeout {puts "shutdown\n"} "AppImage unmounted" } diff --git a/test/appimage/appimage-v2.exp b/test/appimage/appimage-v2.exp index 7d3ba36c2..50466958d 100755 --- a/test/appimage/appimage-v2.exp +++ b/test/appimage/appimage-v2.exp @@ -82,7 +82,7 @@ spawn $env(SHELL) send -- "firejail --shutdown=appimage-test\r" set spawn_id $appimage_id expect { - timeout {puts "TESTING ERROR 7\n";exit} + timeout {puts "shutdown\n"} "AppImage unmounted" } diff --git a/test/appimage/appimage.sh b/test/appimage/appimage.sh index bcd82750e..39c288199 100755 --- a/test/appimage/appimage.sh +++ b/test/appimage/appimage.sh @@ -17,3 +17,6 @@ echo "TESTING: AppImage file name (test/appimage/filename.exp)"; echo "TESTING: AppImage argsv1 (test/appimage/appimage-args.exp)" ./appimage-args.exp + +echo "TESTING: AppImage trace (test/appimage/appimage-trace.exp)" +./appimage-args.exp -- cgit v1.2.3-54-g00ecf