appimage testing

This commit is contained in:
netblue30 2016-11-11 13:14:13 -05:00
parent bb5b4077e6
commit c40736899f
7 changed files with 185 additions and 4 deletions

View file

@ -146,7 +146,7 @@ uninstall:
rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg 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 = "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: dist:
mv config.status config.status.old mv config.status config.status.old
@ -232,7 +232,10 @@ test-arguments:
test-fs: test-fs:
cd test/fs; ./fs.sh | grep TESTING 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" echo "TEST COMPLETE"
# #

6
README
View file

@ -80,6 +80,10 @@ Fred-Barclay (https://github.com/Fred-Barclay)
- evince profile enhancement - evince profile enhancement
- tightened Spotify profile - tightened Spotify profile
- added xiphos and Tor Browser Bundle profiles - 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) BogDan Vatra (https://github.com/bog-dan-ro)
- zoom profile - zoom profile
Impyy (https://github.com/Impyy) Impyy (https://github.com/Impyy)
@ -158,8 +162,6 @@ Rahul Golam (https://github.com/technoLord)
- strings profile - strings profile
geg2048 (https://github.com/geg2048) geg2048 (https://github.com/geg2048)
- kwallet profile fixes - kwallet profile fixes
Simon Peter (https://github.com/probonopd)
- set $APPIMAGE and $APPDIR environment variables
maces (https://github.com/maces) maces (https://github.com/maces)
- Franz messenger profile - Franz messenger profile
KellerFuchs (https://github.com/KellerFuchs) KellerFuchs (https://github.com/KellerFuchs)

Binary file not shown.

81
test/appimage/appimage-v1.exp Executable file
View file

@ -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"

81
test/appimage/appimage-v2.exp Executable file
View file

@ -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"

14
test/appimage/appimage.sh Executable file
View file

@ -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