Change a unit test to exempt boards from hwtests.

This changes a unit test to exempt boards that have
"config.hwqual=false" from hardware tests configured.

BUG=chromium:571645
TEST=unit tests & trybot run

Change-Id: I31c0ae749f4e62572f9c650db6c9b011864892e0
Reviewed-on: https://chromium-review.googlesource.com/319643
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Mungyung Ryu <mkryu@google.com>
diff --git a/cbuildbot/chromeos_config.py b/cbuildbot/chromeos_config.py
index c1f51c4..c17a3a1 100644
--- a/cbuildbot/chromeos_config.py
+++ b/cbuildbot/chromeos_config.py
@@ -894,6 +894,7 @@
       dev_installer_prebuilts=False,
       vm_tests=[],
       vm_tests_override=None,
+      hw_tests=[],
   )
 
   moblab = config_lib.BuildConfig(
diff --git a/cbuildbot/chromeos_config_unittest.py b/cbuildbot/chromeos_config_unittest.py
index a576320..7ebf352 100644
--- a/cbuildbot/chromeos_config_unittest.py
+++ b/cbuildbot/chromeos_config_unittest.py
@@ -270,7 +270,7 @@
     """Make sure all release configs run hw tests."""
     for build_name, config in self.all_configs.iteritems():
       if (config.build_type == 'canary' and 'test' in config.images and
-          config.upload_hw_test_artifacts):
+          config.upload_hw_test_artifacts and config.hwqual):
         self.assertTrue(
             config.hw_tests,
             "Release builder %s must run hw tests." % build_name)
diff --git a/cbuildbot/config_dump.json b/cbuildbot/config_dump.json
index f3cf50f..bd09c97 100644
--- a/cbuildbot/config_dump.json
+++ b/cbuildbot/config_dump.json
@@ -9297,6 +9297,7 @@
         "chrome_sdk": false,
         "dev_installer_prebuilts": false,
         "disk_layout": "base",
+        "hw_tests": [],
         "hwqual": false,
         "image_test": false,
         "important": true,
@@ -9465,6 +9466,7 @@
         "chrome_sdk": false,
         "dev_installer_prebuilts": false,
         "disk_layout": "base",
+        "hw_tests": [],
         "hwqual": false,
         "image_test": false,
         "important": true,
@@ -9653,6 +9655,7 @@
         "chrome_sdk": false,
         "dev_installer_prebuilts": false,
         "disk_layout": "base",
+        "hw_tests": [],
         "hwqual": false,
         "image_test": false,
         "run_gce_tests": true,