Add chromeos site-specific test importer wrappers.
Adjust tests available in Autotest slightly. Also we display the test dirname in the Autotest UI instead of the control file text. People seem to think the dirname is easier to remember.
Review URL: http://codereview.chromium.org/1617004
diff --git a/utils/site_test_importer.sh b/utils/site_test_importer.sh
new file mode 100755
index 0000000..b7260ef
--- /dev/null
+++ b/utils/site_test_importer.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This script adds desired tests to ChromeOS Autotest server.
+
+pushd $(dirname "$0") > /dev/null
+# Clean all tests
+./test_importer.py -C
+
+# Add all site_tests
+./test_importer.py -t /usr/local/autotest/client/site_tests
+./test_importer.py -t /usr/local/autotest/server/site_tests
+
+# Add all profilers
+./test_importer.py -p /usr/local/autotest/client/profilers
+
+# Add selected tests
+./test_importer.py -w site_whitelist_tests
+popd > /dev/null
diff --git a/utils/site_test_importer_attributes.py b/utils/site_test_importer_attributes.py
new file mode 100755
index 0000000..a2a1b50
--- /dev/null
+++ b/utils/site_test_importer_attributes.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+#
+# Copyright 2010 Google Inc. All Rights Reserved.
+"""
+This allows a site to customize the test creation attributes.
+
+"""
+
+
+import common, re
+
+
+def _set_attributes_custom(test, data):
+ # We set the test name to the dirname of the control file.
+ test_new_name = test.path.split('/')
+ if test_new_name[-1] == 'control' or test_new_name[-1] == 'control.srv':
+ test.name = test_new_name[-2]
+ else:
+ control_name = "%s:%s"
+ control_name %= (test_new_name[-2],
+ test_new_name[-1])
+ test.name = re.sub('control.*\.', '', control_name)
+
+ # We set verify to always False (0).
+ test.run_verify = 0
diff --git a/utils/site_whitelist_tests b/utils/site_whitelist_tests
new file mode 100644
index 0000000..9b365c6
--- /dev/null
+++ b/utils/site_whitelist_tests
@@ -0,0 +1,13 @@
+/usr/local/autotest/client/tests/compilebench/control
+/usr/local/autotest/client/tests/dbench/control
+/usr/local/autotest/client/tests/disktest/control
+/usr/local/autotest/client/tests/fsx/control
+/usr/local/autotest/client/tests/hackbench/control
+/usr/local/autotest/client/tests/ltp/control
+/usr/local/autotest/client/tests/ltp/control.ballista
+/usr/local/autotest/client/tests/unixbench/control
+/usr/local/autotest/client/tests/sleeptest/control
+/usr/local/autotest/server/tests/iperf/control.srv
+/usr/local/autotest/server/tests/netperf2/control.srv
+/usr/local/autotest/server/tests/netpipe/control.srv
+/usr/local/autotest/server/tests/sleeptest/control