From c0876aa6b5edb2796330d786660ed4f2075a1fcf Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Mon, 8 Feb 2016 10:10:32 -0500 Subject: [PATCH] test: skip buserror test when SIGBUS is not defined in perl POSIX module Older versions of the perl POSIX module do not define the SIGBUS symbol, which causes the opr/softsig-t perl test to fail to compile. Instead of trying to defined SIGBUS, which may be platform dependent, skip the buserror unit test on these older platforms. Change-Id: Ib8cfd77215ea43566e9d47b501d4989556b83734 Reviewed-on: http://gerrit.openafs.org/12186 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- tests/opr/softsig-t | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/opr/softsig-t b/tests/opr/softsig-t index a2e6fc90c..89e66e5df 100755 --- a/tests/opr/softsig-t +++ b/tests/opr/softsig-t @@ -77,11 +77,17 @@ close(HELPER); is($? & 0x7f, SIGSEGV, "Helper exited on SEGV signal."); # Check that an internal bus error kills the process. - -my ($fh, $path) = mkstemp("/tmp/softsig-t_XXXXXX"); -$pid = open(HELPER, "$softsig_helper -buserror $path |") - or die "Couldn't start test helper."; -close(HELPER); -is($? & 0x7f, SIGBUS, "Helper exited on BUS signal."); -$fh->close; -unlink $path; +# Skip this test when running on ancient versions of Perl +# which do not have SIGBUS defined. +SKIP: { + my $sigbus = eval "SIGBUS"; + skip("Skipping buserror test; SIGBUS constant is not defined.", 1) unless $sigbus; + + my ($fh, $path) = mkstemp("/tmp/softsig-t_XXXXXX"); + $pid = open(HELPER, "$softsig_helper -buserror $path |") + or die "Couldn't start test helper."; + close(HELPER); + is($? & 0x7f, $sigbus, "Helper exited on BUS signal."); + $fh->close; + unlink $path; +} -- 2.39.5