From 8ffb553c75ee69bd5634264fe959db58cfa81378 Mon Sep 17 00:00:00 2001 From: Mark Stemm Date: Mon, 11 Jul 2016 16:33:30 -0700 Subject: [PATCH] Add ability to run branch-specific trace files. Pass the travis branch to run_regression_tests.sh. When downloading trace files, first look for a file traces-XXX-$BRANCH and if found download it. This allows testing out a set of changes with a trace file specifically for that branch, that can be moved to the normal file once the PR is merged. Also increase the timeout for the spawned falco process from 1 to 3 minutes. In debug mode, the kubernetes demo was taking slightly over 1 minute. --- .travis.yml | 4 ++-- test/falco_test.py | 2 +- test/run_regression_tests.sh | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe37c22f..f0678351 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,11 +36,11 @@ script: - make VERBOSE=1 - make package - cd .. - - sudo test/run_regression_tests.sh + - sudo test/run_regression_tests.sh $TRAVIS_BRANCH notifications: webhooks: urls: # - https://webhooks.gitter.im/e/fdbc2356fb0ea2f15033 on_success: change on_failure: always - on_start: never \ No newline at end of file + on_start: never diff --git a/test/falco_test.py b/test/falco_test.py index adb35767..b9358e17 100644 --- a/test/falco_test.py +++ b/test/falco_test.py @@ -42,7 +42,7 @@ class FalcoTest(Test): self.falco_proc = process.SubProcess(cmd) - res = self.falco_proc.run(timeout=60, sig=9) + res = self.falco_proc.run(timeout=180, sig=9) if res.exit_status != 0: self.error("Falco command \"{}\" exited with non-zero return value {}".format( diff --git a/test/run_regression_tests.sh b/test/run_regression_tests.sh index b46646a1..8d63073b 100755 --- a/test/run_regression_tests.sh +++ b/test/run_regression_tests.sh @@ -3,11 +3,13 @@ SCRIPT=$(readlink -f $0) SCRIPTDIR=$(dirname $SCRIPT) MULT_FILE=$SCRIPTDIR/falco_tests.yaml +BRANCH=$1 function download_trace_files() { + echo "branch=$BRANCH" for TRACE in traces-positive traces-negative traces-info ; do rm -rf $SCRIPTDIR/$TRACE - curl -so $SCRIPTDIR/$TRACE.zip https://s3.amazonaws.com/download.draios.com/falco-tests/$TRACE.zip && + curl -fso $SCRIPTDIR/$TRACE.zip https://s3.amazonaws.com/download.draios.com/falco-tests/$TRACE-$BRANCH.zip || curl -fso $SCRIPTDIR/$TRACE.zip https://s3.amazonaws.com/download.draios.com/falco-tests/$TRACE.zip && unzip -d $SCRIPTDIR $SCRIPTDIR/$TRACE.zip && rm -rf $SCRIPTDIR/$TRACE.zip done