Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / integrations / mobly / hello_world_test.py
1 # Copyright (c) 2020 Project CHIP Authors
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 from chip_mobly import pigweed_device
16 from mobly import asserts # type: ignore
17 from mobly import base_test
18 from mobly import test_runner
19
20
21 class HelloWorldTest(base_test.BaseTestClass):
22     def setup_class(self):
23         # Registering pigweed_device controller module declares the test's
24         # dependency on CHIP/Pigweed device hardware. By default, we expect at least one
25         # object is created from this.
26         # Assumes correct image is already flashed.
27         self.ads = self.register_controller(pigweed_device)
28         self.dut = self.ads[0]
29
30     def test_hello(self):
31         expected = "hello!"
32         status, payload = self.dut.rpcs().EchoService.Echo(msg=expected)
33         asserts.assert_true(status.ok(), "Status is %s" % status)
34         asserts.assert_equal(
35             payload.msg,
36             expected,
37             'Returned payload is "%s" expected "%s"' % (payload.msg, expected),
38         )
39
40
41 if __name__ == "__main__":
42     test_runner.main()