Skip to content

Commit

Permalink
tests: use an array
Browse files Browse the repository at this point in the history
  • Loading branch information
a1346054 committed Sep 13, 2022
1 parent e04d6b7 commit d7826c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
5 changes: 2 additions & 3 deletions test/apps/apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ export MALLOC_CHECK_=3
export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
export LC_ALL=C

LIST="firefox midori chromium opera transmission-qt qbittorrent uget-gtk filezilla gthumb thunderbird "
LIST+="vlc fbreader deluge gnome-mplayer xchat wine kcalc ktorrent hexchat"
apps=(firefox midori chromium opera transmission-qt qbittorrent uget-gtk filezilla gthumb thunderbird vlc fbreader deluge gnome-mplayer xchat wine kcalc ktorrent hexchat)

for app in $LIST; do
for app in "${apps[@]}"; do
if command -v "$app"
then
echo "TESTING: $app"
Expand Down
5 changes: 2 additions & 3 deletions test/private-lib/private-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ export MALLOC_CHECK_=3g
export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
export LC_ALL=C

LIST="gnome-logs gnome-system-log gnome-nettool pavucontrol dig evince whois galculator gnome-calculator gedit leafpad mousepad pluma transmission-gtk xcalc atril gpicview eom eog"
apps=(gnome-logs gnome-system-log gnome-nettool pavucontrol dig evince whois galculator gnome-calculator gedit leafpad mousepad pluma transmission-gtk xcalc atril gpicview eom eog)


for app in $LIST; do
for app in "${apps[@]}"; do
if command -v "$app"
then
echo "TESTING: private-lib $app"
Expand Down
8 changes: 4 additions & 4 deletions test/profiles/all-profiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ echo "TESTING: profile read-only links (test/profiles/profile_readonly.exp)"
echo "TESTING: profile no permissions (test/profiles/profile_noperm.exp)"
./profile_noperm.exp

PROFILES=`ls /etc/firejail/*.profile`
profiles=( /etc/firejail/*.profile )
echo "TESTING: default profiles installed in /etc"

for PROFILE in $PROFILES
for profile in "${profiles[@]}"
do
echo "TESTING: $PROFILE"
./test-profile.exp $PROFILE
echo "TESTING: $profile"
./test-profile.exp "$profile"
done
8 changes: 4 additions & 4 deletions test/profiles/profiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ echo "TESTING: profile read-only links (test/profiles/profile_readonly.exp)"
echo "TESTING: profile no permissions (test/profiles/profile_noperm.exp)"
./profile_noperm.exp

PROFILES=`ls /etc/firejail/transmission*.profile /etc/firejail/fi*.profile /etc/firejail/fl*.profile /etc/firejail/free*.profile`
profiles=( /etc/firejail/transmission*.profile /etc/firejail/fi*.profile /etc/firejail/fl*.profile /etc/firejail/free*.profile )
echo "TESTING: small number of default profiles installed in /etc"

for PROFILE in $PROFILES
for profile in "${profiles[@]}"
do
echo "TESTING: $PROFILE"
./test-profile.exp $PROFILE
echo "TESTING: $profile"
./test-profile.exp "$profile"
done

0 comments on commit d7826c2

Please sign in to comment.