1# Copyright 2015 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from autotest_lib.client.bin import test
6from autotest_lib.client.common_lib.cros.tendo import buffet_tester
7
8class buffet_Registration(test.test):
9    """Test that buffet can go through registration."""
10    version = 1
11
12    def initialize(self):
13        self._helper = buffet_tester.BuffetTester()
14
15
16    def run_once(self):
17        # Erase all buffet state and restart it pointing to our fake
18        # server, register with the cloud and check we can poll for
19        # commands.
20        self._helper.restart_buffet(reset_state=True)
21        self._helper.check_buffet_status_is(buffet_tester.STATUS_UNCONFIGURED)
22        device_id = self._helper.register_with_server()
23        self._helper.check_buffet_is_polling(device_id)
24
25
26    def cleanup(self):
27        self._helper.close()
28