diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2005-12-01 01:05:12 (GMT) |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2005-12-01 01:05:12 (GMT) |
commit | f9c07ec61cb09dde465e02ea35b3cc9f832b369c (patch) | |
tree | af3b2b3cf16e4d121605a92a81a1fce6cb6e40c1 | |
parent | e5b45d0e143bd3dbfb870cbe9fd33977db1a2b19 (diff) | |
download | monitoring-plugins-f9c07ec61cb09dde465e02ea35b3cc9f832b369c.tar.gz |
Run longer test on redhat for spopen/pthread problem. Allow enable/disable of
pthread fix via configure option
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1292 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | config_test/Makefile | 6 | ||||
-rwxr-xr-x | config_test/run_tests | 40 | ||||
-rw-r--r-- | configure.in | 29 |
3 files changed, 50 insertions, 25 deletions
diff --git a/config_test/Makefile b/config_test/Makefile index 295696e..1064d56 100644 --- a/config_test/Makefile +++ b/config_test/Makefile | |||
@@ -1,9 +1,11 @@ | |||
1 | 1 | ||
2 | all: child_test.c | 2 | all: child_test |
3 | |||
4 | child_test: child_test.c | ||
3 | gcc -o child_test child_test.c | 5 | gcc -o child_test child_test.c |
4 | 6 | ||
5 | test: | 7 | test: |
6 | ./run_tests 10 | 8 | ./run_tests 10 100 > /dev/null |
7 | 9 | ||
8 | clean: | 10 | clean: |
9 | rm -f child_test | 11 | rm -f child_test |
diff --git a/config_test/run_tests b/config_test/run_tests index e41db23..e7db3ca 100755 --- a/config_test/run_tests +++ b/config_test/run_tests | |||
@@ -1,16 +1,30 @@ | |||
1 | #!/bin/ksh | 1 | #!/bin/ksh |
2 | # $1 is the number of iterations to run | ||
3 | # If $2 is specified, this is the number of times you run each iteration | ||
4 | # If there is a fail at run, exit 1 | ||
5 | # Prints to stdout # of successes and passes | ||
6 | # Prints to stderr a dot for each run | ||
2 | 7 | ||
3 | i=0 | 8 | total_runs=$2 |
4 | success=0 | 9 | [[ -z $total_runs ]] && total_runs=1 |
5 | fail=0 | 10 | run=1 |
6 | while [[ $i -lt $1 ]] ; do | 11 | while [[ $run -le $total_runs ]] ; do |
7 | ./child_test | 12 | i=0 |
8 | if [[ $? -eq 0 ]] ; then | 13 | success=0 |
9 | success=$(($success+1)) | 14 | fail=0 |
10 | else | 15 | while [[ $i -lt $1 ]] ; do |
11 | fail=$((fail+1)) | 16 | ./child_test |
12 | fi | 17 | if [[ $? -eq 0 ]] ; then |
13 | i=$(($i+1)) | 18 | success=$(($success+1)) |
19 | else | ||
20 | fail=$((fail+1)) | ||
21 | fi | ||
22 | i=$(($i+1)) | ||
23 | done | ||
24 | print "Success=$success Fail=$fail" | ||
25 | [[ $fail -gt 0 ]] && exit 1 | ||
26 | run=$(($run+1)) | ||
27 | [[ $total_runs -gt 1 ]] && print -u2 -n "." | ||
14 | done | 28 | done |
15 | print "Success=$success Fail=$fail" | 29 | [[ $total_runs -gt 1 ]] && print -u2 |
16 | [[ $fail -gt 0 ]] && exit 1 | 30 | exit 0 |
diff --git a/configure.in b/configure.in index be9fe83..9303850 100644 --- a/configure.in +++ b/configure.in | |||
@@ -1680,17 +1680,26 @@ dnl Wierd problem where ECHILD is returned from a wait call in error | |||
1680 | dnl Only appears to affect nslookup and dig calls. Only affects redhat around | 1680 | dnl Only appears to affect nslookup and dig calls. Only affects redhat around |
1681 | dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause | 1681 | dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause |
1682 | dnl We patch plugins/popen.c | 1682 | dnl We patch plugins/popen.c |
1683 | dnl Need to add smp because uname different on those. May need to check | 1683 | dnl Need to add smp because uname different on those |
1684 | dnl Fedora Core too in future | 1684 | dnl Can force patch to be applied with --enable-redhat-pthread-workaround |
1685 | if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then | 1685 | AC_ARG_ENABLE(redhat-pthread-workaround, |
1686 | AC_MSG_CHECKING(for redhat spopen problem) | 1686 | AC_HELP_STRING([--enable-redhat-pthread-workaround], |
1687 | ( cd config_test && make && make test ) > /dev/null 2>&1 | 1687 | [force Redhat patch to be applied (default: test system)]), |
1688 | if test $? -eq 0 ; then | 1688 | [ac_cv_enable_redhat_pthread_workaround=$enableval], |
1689 | AC_MSG_RESULT(okay) | 1689 | [ac_cv_enable_redhat_pthread_workaround=test]) |
1690 | else | 1690 | if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then |
1691 | AC_MSG_RESULT(error) | 1691 | if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then |
1692 | AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, "Problem on redhat with spopen") | 1692 | AC_MSG_CHECKING(for redhat spopen problem) |
1693 | ( cd config_test && make && make test ) > /dev/null 2>&1 | ||
1694 | if test $? -eq 0 ; then | ||
1695 | AC_MSG_RESULT(okay) | ||
1696 | else | ||
1697 | AC_MSG_RESULT(error) | ||
1698 | AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen]) | ||
1699 | fi | ||
1693 | fi | 1700 | fi |
1701 | elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then | ||
1702 | AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen]) | ||
1694 | fi | 1703 | fi |
1695 | 1704 | ||
1696 | dnl External libraries - see ACKNOWLEDGEMENTS | 1705 | dnl External libraries - see ACKNOWLEDGEMENTS |