From c40736899fc621946246297e5b1a3964f6172fdb Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 11 Nov 2016 13:14:13 -0500 Subject: appimage testing --- Makefile.in | 7 +- README | 6 +- test/appimage/Leafpad-0.8.17-x86_64.AppImage | Bin 0 -> 786432 bytes .../Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage | Bin 0 -> 231417 bytes test/appimage/appimage-v1.exp | 81 +++++++++++++++++++++ test/appimage/appimage-v2.exp | 81 +++++++++++++++++++++ test/appimage/appimage.sh | 14 ++++ 7 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 test/appimage/Leafpad-0.8.17-x86_64.AppImage create mode 100644 test/appimage/Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage create mode 100755 test/appimage/appimage-v1.exp create mode 100755 test/appimage/appimage-v2.exp create mode 100755 test/appimage/appimage.sh diff --git a/Makefile.in b/Makefile.in index 6ea9e897f..83d44fb1c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -146,7 +146,7 @@ uninstall: rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg DISTFILES = "src etc platform configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh mkuid.sh COPYING README RELNOTES" -DISTFILES_TEST = "test/apps test/apps-x11 test/apps-x11-xorg test/root test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils" +DISTFILES_TEST = "test/apps test/apps-x11 test/apps-x11-xorg test/appimage test/root test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils" dist: mv config.status config.status.old @@ -232,7 +232,10 @@ test-arguments: test-fs: cd test/fs; ./fs.sh | grep TESTING -test: test-profiles test-fs test-utils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments +test-appimage: + cd test/appimage; ./appimage.sh | grep TESTING + +test: test-profiles test-fs test-utils test-environment test-appimage test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments echo "TEST COMPLETE" # diff --git a/README b/README index 2051f2901..69e5e6337 100644 --- a/README +++ b/README @@ -80,6 +80,10 @@ Fred-Barclay (https://github.com/Fred-Barclay) - evince profile enhancement - tightened Spotify profile - added xiphos and Tor Browser Bundle profiles +Simon Peter (https://github.com/probonopd) + - set $APPIMAGE and $APPDIR environment variables + - AppImage version detection + - Leafppad type v1 and v2 appimage packages in test/appimage BogDan Vatra (https://github.com/bog-dan-ro) - zoom profile Impyy (https://github.com/Impyy) @@ -158,8 +162,6 @@ Rahul Golam (https://github.com/technoLord) - strings profile geg2048 (https://github.com/geg2048) - kwallet profile fixes -Simon Peter (https://github.com/probonopd) - - set $APPIMAGE and $APPDIR environment variables maces (https://github.com/maces) - Franz messenger profile KellerFuchs (https://github.com/KellerFuchs) diff --git a/test/appimage/Leafpad-0.8.17-x86_64.AppImage b/test/appimage/Leafpad-0.8.17-x86_64.AppImage new file mode 100644 index 000000000..865f6b44c Binary files /dev/null and b/test/appimage/Leafpad-0.8.17-x86_64.AppImage differ diff --git a/test/appimage/Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage b/test/appimage/Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage new file mode 100644 index 000000000..d167431f3 Binary files /dev/null and b/test/appimage/Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage differ diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp new file mode 100755 index 000000000..88687ae2a --- /dev/null +++ b/test/appimage/appimage-v1.exp @@ -0,0 +1,81 @@ +#!/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 --appimage Leafpad-0.8.17-x86_64.AppImage\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 2 + +spawn $env(SHELL) +send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + ":firejail" +} +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "appimage Leafpad" +} +after 100 + +# grsecurity exit +send -- "file /proc/sys/kernel/grsecurity\r" +expect { + timeout {puts "TESTING ERROR - grsecurity detection\n";exit} + "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} + "cannot open" {puts "grsecurity not present\n"} +} + + +send -- "firejail --name=blablabla\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 2 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} + "appimage Leafpad" +} +expect { + timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} + "Seccomp: 2" +} +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "name=blablabla" +} +after 100 +send -- "firemon --caps\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "appimage Leafpad" +} +expect { + timeout {puts "TESTING ERROR 6.1\n";exit} + "CapBnd:" +} +expect { + timeout {puts "TESTING ERROR 6.2\n";exit} + "0000000000000000" +} +expect { + timeout {puts "TESTING ERROR 6.3\n";exit} + "name=blablabla" +} +after 100 + +puts "\nall done\n" + diff --git a/test/appimage/appimage-v2.exp b/test/appimage/appimage-v2.exp new file mode 100755 index 000000000..7b3bf4cbd --- /dev/null +++ b/test/appimage/appimage-v2.exp @@ -0,0 +1,81 @@ +#!/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 --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 2 + +spawn $env(SHELL) +send -- "firejail --list\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + ":firejail" +} +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + "appimage Leafpad" +} +after 100 + +# grsecurity exit +send -- "file /proc/sys/kernel/grsecurity\r" +expect { + timeout {puts "TESTING ERROR - grsecurity detection\n";exit} + "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} + "cannot open" {puts "grsecurity not present\n"} +} + + +send -- "firejail --name=blablabla\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 2 + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} + "appimage Leafpad" +} +expect { + timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} + "Seccomp: 2" +} +expect { + timeout {puts "TESTING ERROR 5.1\n";exit} + "name=blablabla" +} +after 100 +send -- "firemon --caps\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "appimage Leafpad" +} +expect { + timeout {puts "TESTING ERROR 6.1\n";exit} + "CapBnd:" +} +expect { + timeout {puts "TESTING ERROR 6.2\n";exit} + "0000000000000000" +} +expect { + timeout {puts "TESTING ERROR 6.3\n";exit} + "name=blablabla" +} +after 100 + +puts "\nall done\n" + diff --git a/test/appimage/appimage.sh b/test/appimage/appimage.sh new file mode 100755 index 000000000..6a73d0a7e --- /dev/null +++ b/test/appimage/appimage.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# This file is part of Firejail project +# Copyright (C) 2014-2016 Firejail Authors +# License GPL v2 + +export MALLOC_CHECK_=3 +export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) + +echo "TESTING: AppImage v1 (test/appimage/appimage-v1.exp)" +./appimage-v1.exp + +echo "TESTING: AppImage v2 (test/appimage/appimage-v2.exp)" +./appimage-v1.exp + -- cgit v1.2.3-70-g09d2