gcov testing

This commit is contained in:
netblue30 2026-01-16 11:17:29 -05:00
parent 0271544fef
commit 2f6afc99d5
21 changed files with 71 additions and 5 deletions

View file

@ -203,7 +203,7 @@ clean:
.PHONY: distclean
distclean: clean
$(RM) -r autom4te.cache config.log config.mk config.sh config.status test/fnetfilter/outfile test/fnettrace/index.html test/chroot/unchroot
$(RM) -r autom4te.cache config.log config.mk config.sh config.status test/fnetfilter/outfile test/fnettrace/index.html test/chroot/unchroot test/fcopy/src/dircopy.exp
.PHONY: install
install: all config.mk

View file

@ -12,9 +12,11 @@
# run as regular user: ./gcov.sh
# result in gcov-dir/index.html
echo
echo "checking gcov data"
echo
if test -f ../../src/firejail/main.gcno; then
if test -f src/firejail/main.gcno; then
rm -fr gcov-dir
sleep 1
mkdir gcov-dir

View file

@ -18,6 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "firejail.h"
#include "../include/gcov_wrapper.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
@ -75,6 +76,7 @@ int x11_display(void) {
if (arg_debug)
fprintf(stderr, "DISPLAY=%s parsed as %lu\n", display_str, display);
__gcov_flush();
return (int)display;
}
@ -116,6 +118,8 @@ static int x11_abstract_sockets_present(void) {
free(linebuf);
fclose(fp);
__gcov_flush();
return found;
}
@ -196,6 +200,8 @@ static int random_display_number(void) {
"exiting...\n", stderr);
exit(1);
}
__gcov_flush();
return display;
}
#endif
@ -397,6 +403,7 @@ void x11_start_xvfb(int argc, char **argv) {
// jail process ends and releases terminal
wait(NULL); // fulneral
__gcov_flush();
exit(0);
}
@ -640,6 +647,7 @@ void x11_start_xephyr(int argc, char **argv) {
// jail process ends and releases terminal
wait(NULL); // fulneral
__gcov_flush();
exit(0);
}
@ -697,6 +705,7 @@ static char * get_title_arg_str() {
strcpy(title_arg_str, title_start);
}
__gcov_flush();
return title_arg_str;
}
@ -1074,6 +1083,7 @@ static void __attribute__((noreturn)) x11_start_xpra_new(int argc, char **argv,
}
// start
__gcov_flush();
server = fork();
if (server < 0)
errExit("fork");
@ -1139,6 +1149,7 @@ void x11_start_xpra(int argc, char **argv) {
x11_start_xpra_new(argc, argv, display_str);
else
x11_start_xpra_old(argc, argv, display, display_str);
__gcov_flush();
}
@ -1166,6 +1177,7 @@ void x11_start(int argc, char **argv) {
fprintf(stderr, " Fedora: sudo dnf install xorg-x11-server-Xephyr\n");
exit(0);
}
__gcov_flush();
}
#endif

View file

@ -33,3 +33,6 @@ if [[ -f /sys/kernel/security/apparmor/profiles ]]; then
else
echo "TESTING SKIP: no apparmor support in Linux kernel (test/filters/apparmor.exp)"
fi
cd ../../
./mkgcov.sh

View file

@ -18,3 +18,6 @@ echo "TESTING: AppImage args (test/appimage/appimage-args.exp)"
echo "TESTING: AppImage trace (test/appimage/appimage-trace.exp)"
./appimage-trace.exp
cd ../../
./mkgcov.sh

View file

@ -20,3 +20,6 @@ for app in "${apps[@]}"; do
fi
sleep 1
done
cd ../../
./mkgcov.sh

View file

@ -23,3 +23,6 @@ echo "TESTING: capabilities join (test/filters/caps-join.exp)"
echo "TESTING: firemon caps (test/utils/firemon-caps.exp)"
./firemon-caps.exp
cd ../../
./mkgcov.sh

View file

@ -25,3 +25,6 @@ echo "TESTING: unchroot as root (test/chroot/unchroot-as-root.exp)"
sudo ./unchroot-as-root.exp
rm -f unchroot
cd ../../
./mkgcov.sh

View file

@ -101,3 +101,6 @@ echo "TESTING: keep fd errors (test/environment/keep-fd-bad.exp)"
echo "TESTING: retain umask (test/environment/umask.exp)"
(umask 123 && ./umask.exp)
cd ../../
./mkgcov.sh

View file

@ -30,3 +30,8 @@ echo "TESTING: fcopy directory (test/fcopy/dircopy.exp)"
rm -fr dest/*
rm -f src/dircopy.exp
cd ../..
./mkgcov.sh

View file

@ -134,3 +134,6 @@ if [[ $(uname -m) == "x86_64" ]]; then
else
echo "TESTING SKIP: seccomp join test implemented only for x86_64"
fi
cd ../../
./mkgcov.sh

View file

@ -15,4 +15,6 @@ echo "TESTING: firecfg (test/firecfg/firecfg.exp)"
./firecfg.exp
sudo rm -fr /tmp/ttt
../../mkgcov.sh
cd ../../
./mkgcov.sh

View file

@ -29,3 +29,6 @@ echo "TESTING: fnetfilter template (test/fnetfilter/template.exp)"
./template.exp
rm -f outfile
cd ../../
./mkgcov.sh

View file

@ -57,3 +57,5 @@ echo "TESTING: fnettrace-check-root (test/nettrace/fnettrace-check-root.exp)"
#rm -f /tmp/output
#echo "all done"
cd ../../
./mkgcov.sh

View file

@ -162,3 +162,6 @@ echo "TESTING: fscheck --read-only= (test/fs/fscheck-readonly.exp)"
#cleanup
rm -fr ~/_firejail_test*
cd ../../
./mkgcov.sh

View file

@ -62,3 +62,6 @@ echo "TESTING: netfilter-template (netfilter-template.exp)"
sudo ip link set br0 down
sudo brctl delbr br0
cd ../../
./mkgcov.sh

View file

@ -21,3 +21,6 @@ echo "TESTING: etc-cleanup (test/private-etc/etc-cleanup.exp)"
echo "TESTING: hostname (test/private-etc/hostname.exp)"
./hostname.exp
cd ../../
./mkgcov.sh

View file

@ -58,4 +58,5 @@ do
./test-profile.exp "$profile"
done
../../mkgcov.sh
cd ../../
./mkgcov.sh

View file

@ -24,3 +24,6 @@ echo "TESTING: mrwx2 (test/seccomp-extras/mrwx.exp)"
echo "TESTING: block-secondary (test/seccomp-extras/block-secondary.exp)"
./block-secondary.exp
cd ../../
./mkgcov.sh

View file

@ -150,3 +150,6 @@ then
else
echo "TESTING SKIP: whois not found"
fi
cd ../../
./mkgcov.sh

View file

@ -135,3 +135,6 @@ echo "TESTING: firemon version (test/utils/firemon-version.exp)"
echo "TESTING: firemon name (test/utils/firemon-name.exp)"
./firemon-name.exp
cd ../../
./mkgcov.sh