diff options
author | Jirka Hladky <jhladky@redhat.com> | 2021-03-24 02:13:07 +0100 |
---|---|---|
committer | Jirka Hladky <jhladky@redhat.com> | 2021-03-24 02:13:07 +0100 |
commit | 8d93c7f2aaf23ade38dc62e145a2e729ef263075 (patch) | |
tree | 161c78375d4efa8c0409826328c253f38957101f | |
parent | Update README.md (diff) | |
download | haveged-8d93c7f2aaf23ade38dc62e145a2e729ef263075.tar.xz haveged-8d93c7f2aaf23ade38dc62e145a2e729ef263075.zip |
Improved make check command
-rwxr-xr-x | configure | 26 | ||||
-rw-r--r-- | ent/Makefile.am | 7 | ||||
-rw-r--r-- | ent/Makefile.in | 27 | ||||
-rw-r--r-- | ent/examine_chi_square.R | 13 | ||||
-rwxr-xr-x | ent/examine_chi_square.sh | 15 | ||||
-rwxr-xr-x | ent/test.sh | 18 |
6 files changed, 89 insertions, 17 deletions
@@ -12776,7 +12776,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF -for ac_func in __rdtsc accept accept4 bind connect execv floor getsockopt gettimeofday listen memset pow pselect recv sched_yield select send setsockopt socket sqrt +for ac_func in __rdtsc accept accept4 bind connect execv floor getauxval getsockopt gettimeofday listen memset pow pselect recv sched_yield select send setsockopt socket sqrt do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -13022,6 +13022,18 @@ fi done +for ac_header in sys/auxv.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/auxv.h" "ac_cv_header_sys_auxv_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_auxv_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_AUXV_H 1 +_ACEOF + +fi + +done + for ac_header in sys/ioctl.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" @@ -13034,6 +13046,18 @@ fi done +for ac_header in sys/auxv.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/auxv.h" "ac_cv_header_sys_auxv_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_auxv_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_AUXV_H 1 +_ACEOF + +fi + +done + for ac_header in sys/mman.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" diff --git a/ent/Makefile.am b/ent/Makefile.am index 265504c..ba11747 100644 --- a/ent/Makefile.am +++ b/ent/Makefile.am @@ -10,13 +10,14 @@ entest_LDADD = -lm entest_SOURCES = entest.c iso8859.c randtest.c chisq.c iso8859.h randtest.h -CLEANFILES = sample +CLEANFILES = sample *log +clean-local: + rm -rf chi_square MAINTAINERCLEANFILES = Makefile.in if ENABLE_ENT_TEST check-local: ./entest -t ${srcdir}/entitle.gif - ../src/haveged -n 16384k -v 1 $* - ./entest -vf sample + ./test.sh endif diff --git a/ent/Makefile.in b/ent/Makefile.in index 49931f5..f3df960 100644 --- a/ent/Makefile.in +++ b/ent/Makefile.in @@ -285,7 +285,7 @@ top_srcdir = @top_srcdir@ AM_CFLAGS = -Wall entest_LDADD = -lm entest_SOURCES = entest.c iso8859.c randtest.c chisq.c iso8859.h randtest.h -CLEANFILES = sample +CLEANFILES = sample *log MAINTAINERCLEANFILES = Makefile.in all: all-am @@ -481,7 +481,7 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ +clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am @@ -551,26 +551,27 @@ uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ - clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + clean-checkPROGRAMS clean-generic clean-libtool clean-local \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile +clean-local: + rm -rf chi_square @ENABLE_ENT_TEST_TRUE@check-local: @ENABLE_ENT_TEST_TRUE@ ./entest -t ${srcdir}/entitle.gif -@ENABLE_ENT_TEST_TRUE@ ../src/haveged -n 16384k -v 1 $* -@ENABLE_ENT_TEST_TRUE@ ./entest -vf sample +@ENABLE_ENT_TEST_TRUE@ ./test.sh # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/ent/examine_chi_square.R b/ent/examine_chi_square.R new file mode 100644 index 0000000..43771fd --- /dev/null +++ b/ent/examine_chi_square.R @@ -0,0 +1,13 @@ +d <- read.table('chi.txt', header = FALSE, sep = "", dec = ".") +summary(d) +h <- hist(d[,1],breaks=20) +chisq.test(h$counts) +h$counts=h$counts/sum(h$counts) +x11() +plot(h, col = "gray") +curve(100/length(h$counts)*dunif(x,0,100),add=TRUE, col="red") +x11() +ks.test(d[,1], "punif", 0, 100) +plot(ecdf(d[,1])) +curve(punif(x, 0, 100), add=TRUE, col="red") +#locator(1) diff --git a/ent/examine_chi_square.sh b/ent/examine_chi_square.sh new file mode 100755 index 0000000..ef56470 --- /dev/null +++ b/ent/examine_chi_square.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +#for i in $(seq -w 1000); do +# ./entest -vf <(head -c 16M /dev/random) > "${i}_linux.log" +#done + +mkdir chi_square +pushd chi_square || exit 1 +for i in $(seq -w 1000); do + ../entest -vf <(../../src/haveged -n 16384k -f -) > "${i}_haveged.log" +done + +grep -Poh "Chi-Square: .*\(\K[0-9.]+" ./*haveged.log > ./chi.txt +R --vanilla <../examine_chi_square.R > examine_chi_square.summary +popd || exit 1 diff --git a/ent/test.sh b/ent/test.sh new file mode 100755 index 0000000..59f8a82 --- /dev/null +++ b/ent/test.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +runs=10 +for i in $(seq -w "$runs"); do + ./entest -vf <(../src/haveged -n 16384k -f -) > "${i}_entest.log" +done + +fails=$(grep Fail ./*_entest.log | wc -l) + +if (( fails > 2 )); then + echo "Total $fails in $runs" + grep Fail ./*_entest.log + echo "Marking the whole test as failed" + exit 255 +else + echo "Test passed!" +fi + |