Ejemplo n.º 1
0
 def testDiskInfo(self):
     global package_installed
     sshclient = ServerMgrSSHClient(None)
     sshclient.filename = 'disk_info/disk_info_expected_output.txt'
     self.ipmonitor.fetch_and_process_disk_info("dummy", "dummy", sshclient)
     #Test the case where the diff between the previous and current iteration is sent
     sshclient.filename = 'disk_info/disk_info_diff_expected_output.txt'
     self.ipmonitor.fetch_and_process_disk_info("dummy", "dummy", sshclient)
     #Test the situation where the sysstat package is not installed on the target node
     package_installed = False
     self.ipmonitor.fetch_and_process_disk_info("dummy", "dummy", sshclient)
     sshclient.filename = 'disk_info/disk_info_wrong_output.txt'
     #Make sure the exception is raised. If the exception is not raised the test case will fail
     package_installed = True
     with self.assertRaises(Exception):
         self.ipmonitor.fetch_and_process_disk_info("dummy","dummy",sshclient)
Ejemplo n.º 2
0
 def testDiskInfo(self):
     global package_installed
     sshclient = ServerMgrSSHClient(None)
     sshclient.filename = 'disk_info/disk_info_expected_output.txt'
     self.ipmonitor.fetch_and_process_disk_info("dummy", "dummy", sshclient)
     #Test the case where the diff between the previous and current iteration is sent
     sshclient.filename = 'disk_info/disk_info_diff_expected_output.txt'
     self.ipmonitor.fetch_and_process_disk_info("dummy", "dummy", sshclient)
     #Test the situation where the sysstat package is not installed on the target node
     package_installed = False
     self.ipmonitor.fetch_and_process_disk_info("dummy", "dummy", sshclient)
     sshclient.filename = 'disk_info/disk_info_wrong_output.txt'
     #Make sure the exception is raised. If the exception is not raised the test case will fail
     package_installed = True
     with self.assertRaises(Exception):
         self.ipmonitor.fetch_and_process_disk_info("dummy", "dummy",
                                                    sshclient)