Brillo: refactor configs yet again and get test images built on brillo builders.

So at this point there's 2 notions that are not accurately reflected in
cbuildbot_config creating a confusing mess:

1) We have brillo builds that should be testable at some point using our hw /
vm tests etc
2) There may be some brillo builds that do not fall under this category.

This CL codifies that and has all builders that should be in either category
correctly derive from those classes.

In addition I've removed the build_tests->'test_image' check since this isn't
valid. You can have a test image without building any autotest tests. There
are reasons to have the former without the latter.

BUG=None
TEST=Compared brillo specs before/after + unittests
Diff:
beaglebone-incremental:
 sync_chrome: None, False

duck-paladin:
 images: [u'base'], [u'test']
 packages: [u'chromeos-base/chromeos'], []

duck-release:
 images: [u'base'], [u'base', u'test']
 packages: [u'chromeos-base/chromeos'], []

stumpy_moblab-paladin:
 packages: [], [u'chromeos-base/chromeos']
 sync_chrome: None, False

stumpy_moblab-release:
 chrome_sdk: True, False
 packages: [], [u'chromeos-base/chromeos']
 sync_chrome: None, False

Change-Id: I5dfa24f1496e1b60f172489d01cbffa1b61d8332
Reviewed-on: https://chromium-review.googlesource.com/188420
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
diff --git a/buildbot/cbuildbot_config.py b/buildbot/cbuildbot_config.py
index 9e1f789..543e777 100755
--- a/buildbot/cbuildbot_config.py
+++ b/buildbot/cbuildbot_config.py
@@ -872,17 +872,31 @@
   hw_tests=[],
 )
 
-# Base brillo config don't build tests and they only need the base image.
 brillo = _config(
-  images=['base'],
-  packages=['chromeos-base/chromeos'],
-  build_tests=False,
   sync_chrome=False,
   chrome_sdk=False,
+
+  # TODO(gauravsh): Should be set to True once testing works.
+  build_tests=False,
+  signer_tests=False,
+  vm_tests=[],
   hw_tests=[],
 )
 
-beaglebone = arm.derive(brillo, rootfs_verification=False)
+# Base brillo config don't build tests and they only need the base image.
+brillo_non_testable = brillo.derive(
+  # Literally build the minimal possible.
+  packages=['chromeos-base/chromeos'],
+  images=['base'],
+
+  # Disable all the tests!
+  build_tests=False,
+  signer_tests=False,
+  hw_tests=[],
+  vm_tests=[],
+)
+
+beaglebone = arm.derive(brillo_non_testable, rootfs_verification=False)
 
 # This adds Chrome branding.
 official_chrome = _config(
@@ -1246,14 +1260,10 @@
   description='Build with Address Sanitizer (Clang) on TOT',
 )
 
-incremental_arm = incremental.derive(arm)
-incremental_arm.add_config('beaglebone-incremental',
+incremental_beaglebone = incremental.derive(beaglebone)
+incremental_beaglebone.add_config('beaglebone-incremental',
   boards=['beaglebone'],
-  images=['base'],
-  packages=['chromeos-base/chromeos'],
   trybot_list=True,
-  build_tests=False,
-  rootfs_verification=False,
   description='Incremental Beaglebone Builder',
 )
 
@@ -1551,7 +1561,7 @@
 internal_paladin.add_config('stout-paladin',
   boards=['stout'],
   paladin_builder_name='stout paladin',
-  vm_tests = [constants.CROS_VM_TEST_TYPE],
+  vm_tests=[constants.CROS_VM_TEST_TYPE],
 )
 
 internal_paladin.add_config('stout32-paladin',
@@ -1579,12 +1589,10 @@
 )
 
 internal_paladin.add_config('stumpy_moblab-paladin',
+  brillo_non_testable,
   boards=['stumpy_moblab'],
-  images=['base'],
-  build_tests=False,
   important=False,
   paladin_builder_name='stumpy_moblab paladin',
-  hw_tests=[],
 )
 
 
@@ -1952,8 +1960,7 @@
 # Brillo devices do not have Chrome or currently need for test or dev images.
 _brillo_release = _release.derive(brillo,
   dev_installer_prebuilts=False,
-  signer_tests=False,
-  vm_tests=[],
+  images=['base', 'test']
 )
 
 _brillo_release.add_config('duck-release',
@@ -1976,18 +1983,15 @@
 # Note this is named full since it doesn't use manifest_versions and uses
 # different scheduling. However, it still pushes releases.
 _arm_brillo_release.add_config('daisy_winter-full',
+  brillo_non_testable,
   boards=['daisy_winter'],
   manifest='lasercats.xml',
   manifest_version=False,
 )
 
 _release.add_config('stumpy_moblab-release',
+  brillo_non_testable,
   boards=['stumpy_moblab'],
-  images=['base'],
-  build_tests=False,
-  signer_tests=False,
-  hw_tests=[],
-  vm_tests=[],
 )
 
 # Factory and Firmware releases much inherit from these classes.  Modifications
diff --git a/buildbot/cbuildbot_config_unittest.py b/buildbot/cbuildbot_config_unittest.py
index 5f5595d..30708ba 100755
--- a/buildbot/cbuildbot_config_unittest.py
+++ b/buildbot/cbuildbot_config_unittest.py
@@ -266,8 +266,6 @@
       if not config['build_tests']:
         self.assertFalse('factory_test' in config['images'],
             'Config %s builds factory_test without build_tests.' % build_name)
-        self.assertFalse('test' in config['images'],
-            'Config %s builds test image without build_tests.' % build_name)
         for flag in ('vm_tests', 'hw_tests'):
           self.assertFalse(config[flag],
               'Config %s set %s without build_tests.' % (build_name, flag))