Example #1
0
 def test_from_tarball(self, host_cls, print_system_info):
     sys.argv = ['hwinfo', '-l', 'ack-submission.tar.gz']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     host_cls.assert_called_with('ack-submission.tar.gz')
Example #2
0
 def test_local_machine_filter_for_gpu(self, host_cls, print_system_info):
     sys.argv = ['hwinfo', '-f', 'gpu']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     print_system_info.assert_called_with(mhost, ['gpu'])
Example #3
0
 def test_export(self, host_cls, export_system_info):
     sys.argv = ['hwinfo', '-e']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     export_system_info.assert_called_with(mhost, self.OPTIONS)
Example #4
0
 def test_remote_machine(self, host_cls, print_system_info):
     sys.argv = ['hwinfo', '-m', 'test', '-u', 'root', '-p', 'pass']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     host_cls.assert_called_with('test', 'root' , 'pass')
     print_system_info.assert_called_with(mhost, self.OPTIONS)
Example #5
0
 def test_host_from_logs(self, host_cls, print_system_info):
     sys.argv = ['hwinfo', '-l', '/tmp/thisisatestpath']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     host_cls.assert_called_with('/tmp/thisisatestpath')
     print_system_info.assert_called_with(mhost, self.OPTIONS)
Example #6
0
 def test_from_tarball(self, host_cls, system_info):
     sys.argv = ['hwinfo', '-l', 'ack-submission.tar.gz']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     host_cls.assert_called_with('ack-submission.tar.gz')
Example #7
0
 def test_local_machine(self, argv, host_cls, print_system_info):
     argv = ['hwinfo']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     host_cls.assert_called_with('localhost',None, None)
     print_system_info.assert_called_with(mhost, self.OPTIONS)
Example #8
0
 def test_export(self, host_cls, export_system_info):
     sys.argv = ['hwinfo', '-e']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     export_system_info.assert_called_with(mhost, self.OPTIONS)
Example #9
0
 def test_local_machine_filter_for_gpu(self, host_cls, system_info):
     sys.argv = ['hwinfo', '-f', 'gpu']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     system_info.assert_called_with(mhost, ['gpu'])
Example #10
0
 def test_host_from_logs(self, host_cls, system_info):
     sys.argv = ['hwinfo', '-l', '/tmp/thisisatestpath']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     host_cls.assert_called_with('/tmp/thisisatestpath')
     system_info.assert_called_with(mhost, self.OPTIONS)
Example #11
0
 def test_remote_machine(self, host_cls, system_info):
     sys.argv = ['hwinfo', '-m', 'test', '-u', 'root', '-p', 'pass']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     host_cls.assert_called_with('test', 'root', 'pass')
     system_info.assert_called_with(mhost, self.OPTIONS)
Example #12
0
 def test_local_machine(self, argv, host_cls, system_info):
     argv = ['hwinfo']
     mhost = host_cls.return_value = mock.MagicMock()
     inspector.main()
     host_cls.assert_called_with('localhost', None, None)
     system_info.assert_called_with(mhost, self.OPTIONS)