1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
13 from vstf.controller.env_build import env_collect
14 from vstf.controller.unittest import model
17 class TestCollect(model.Test):
20 super(TestCollect, self).setUp()
21 self.obj = env_collect.EnvCollectApi(self.conn)
23 def test_collect_host_info(self):
25 self.obj.collect_host_info(
26 self.tester_host), indent=4)
27 for key in ("CPU INFO", "MEMORY INFO", "HW_INFO", "OS INFO"):
30 "collect_host_info failed, ret_str = %s" %
33 def test_list_nic_devices(self):
35 self.obj.list_nic_devices(
36 self.tester_host), indent=4)
37 for key in ("device", "mac", "bdf", "desc"):
40 "list_nic_devices failed, ret_str = %s" %
44 def test_get_device_detail(self):
46 ret = self.obj.get_device_detail(self.tester_host, "01:00.0")
47 for key in ("device", "mac", "bdf", "desc"):
48 self.assertTrue(key in ret)
49 self.assertTrue(ret['bdf'] == identity)
52 if __name__ == "__main__":
54 logging.basicConfig(level=logging.INFO)