From patchwork Tue Nov 24 16:39:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 548153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40C3114030F for ; Wed, 25 Nov 2015 03:40:40 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1Gdn-00046L-7E; Tue, 24 Nov 2015 16:40:27 +0000 Received: from s3.sipsolutions.net ([5.9.151.49] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1Gdk-0002w0-ER for hostap@lists.infradead.org; Tue, 24 Nov 2015 16:40:25 +0000 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.86) (envelope-from ) id 1a1GdN-0004Jm-0O; Tue, 24 Nov 2015 17:40:01 +0100 From: Johannes Berg To: hostap@lists.infradead.org Subject: [PATCH] tests: honour HWSIM_TEST_LOG_DIR variable Date: Tue, 24 Nov 2015 17:39:58 +0100 Message-Id: <1448383198-4354-1-git-send-email-johannes@sipsolutions.net> X-Mailer: git-send-email 2.6.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151124_084024_683964_95B4921B X-CRM114-Status: UNSURE ( 8.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Berg MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg If /tmp has a relatively small size limit, or multiple people run the tests on the same machine, using the same output directory can easily cause problems. Make the test framework honour the new HWSIM_TEST_LOG_DIR environment variable to make it easier to avoid those problems. Signed-off-by: Johannes Berg --- tests/hwsim/vm/parallel-vm.py | 15 ++++++++------- tests/hwsim/vm/parallel-vm.sh | 6 +++++- tests/hwsim/vm/vm-run.sh | 6 +++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/tests/hwsim/vm/parallel-vm.py b/tests/hwsim/vm/parallel-vm.py index 40ab5e397714..e40d44fbad86 100755 --- a/tests/hwsim/vm/parallel-vm.py +++ b/tests/hwsim/vm/parallel-vm.py @@ -352,6 +352,13 @@ def main(): help="run tests under valgrind") p.add_argument('params', nargs='*') args = p.parse_args() + + dir = os.environ.get('HWSIM_TEST_LOG_DIR', '/tmp/hwsim-test-logs') + try: + os.makedirs(dir) + except: + pass + num_servers = args.num_servers rerun_failures = not args.no_retry if args.debug: @@ -363,7 +370,7 @@ def main(): extra_args += [ '--long' ] if args.codecov: print "Code coverage - build separate binaries" - logdir = "/tmp/hwsim-test-logs/" + str(timestamp) + logdir = os.path.join(dir, str(timestamp)) os.makedirs(logdir) subprocess.check_call([os.path.join(scriptsdir, 'build-codecov.sh'), logdir]) @@ -390,12 +397,6 @@ def main(): if len(tests) == 0: sys.exit("No test cases selected") - dir = '/tmp/hwsim-test-logs' - try: - os.mkdir(dir) - except: - pass - if args.shuffle: from random import shuffle shuffle(tests) diff --git a/tests/hwsim/vm/parallel-vm.sh b/tests/hwsim/vm/parallel-vm.sh index b2fd0786fd7b..f9e22d95b6af 100755 --- a/tests/hwsim/vm/parallel-vm.sh +++ b/tests/hwsim/vm/parallel-vm.sh @@ -9,7 +9,11 @@ if [ -z "$NUM" ]; then fi shift -LOGS=/tmp/hwsim-test-logs +if [ -n "$HWSIM_TEST_LOG_DIR" ] ; then + LOGS="$HWSIM_TEST_LOG_DIR" +else + LOGS=/tmp/hwsim-test-logs +fi mkdir -p $LOGS DATE=$(date +%s) diff --git a/tests/hwsim/vm/vm-run.sh b/tests/hwsim/vm/vm-run.sh index 98af2a4156c2..ab4df4c100be 100755 --- a/tests/hwsim/vm/vm-run.sh +++ b/tests/hwsim/vm/vm-run.sh @@ -6,7 +6,11 @@ if [ -z "$TESTDIR" ] ; then TESTDIR=$(pwd)/../ fi -LOGS=/tmp/hwsim-test-logs +if [ -n "$HWSIM_TEST_LOG_DIR" ] ; then + LOGS="$HWSIM_TEST_LOG_DIR" +else + LOGS=/tmp/hwsim-test-logs +fi # increase the memory size if you want to run with valgrind, 512 MB works MEMORY=192