[autotest] Loosens board list check when adding new board labels.
testbed may have a mix of different boards. This change loosens the board list
check to allow any board labels ending with -number to be added to a host.
BUG=chromium:660271
TEST=unittest
Change-Id: If5f8487472f1092b5ebc24e3df90c7965aa382d0
Reviewed-on: https://chromium-review.googlesource.com/407068
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
diff --git a/frontend/afe/models_test.py b/frontend/afe/models_test.py
index c404fde..a4eabfd 100755
--- a/frontend/afe/models_test.py
+++ b/frontend/afe/models_test.py
@@ -67,16 +67,17 @@
self.assertEquals(host2.status, models.Host.Status.RUNNING)
- def test_check_no_board(self):
+ def test_check_board_labels_allowed(self):
host = models.Host.create_one_time_host('othost')
# First check with host with no board label.
- self.assertEqual(host.check_no_board([host]), None)
+ self.assertEqual(host.check_board_labels_allowed([host]), None)
# Second check with host with board label
label = models.Label.add_object(name='board:test')
label.host_set.add(host)
self.assertRaises(model_logic.ValidationError,
- host.check_no_board, [host])
+ host.check_board_labels_allowed, [host],
+ ['board:new_board'])
class SpecialTaskUnittest(unittest.TestCase,