Exemplo n.º 1
0
 def test_collect_disk_whitelist(self):
     s = Statser()
     if platform.system() == "Windows":
       d = "PhysicalDrive0"
     else:
       d = "sda1"
     s.collect_disk_io([d])
     self.assertTrue(s.db)
     for e in s.db:
         # make sure that every entry has only sda1 in the name
         self.assertTrue(d in e["name"])
Exemplo n.º 2
0
 def test_collect_disk_whitelist(self):
     s = Statser()
     if platform.system() == "Windows":
         d = "PhysicalDrive0"
     else:
         d = "sda1"
     s.collect_disk_io([d])
     self.assertTrue(s.db)
     for e in s.db:
         # make sure that every entry has only sda1 in the name
         self.assertTrue(d in e["name"])
Exemplo n.º 3
0
 def test_collect_network_whitelist(self):
     s = Statser()
     needle="lo"
     if platform.system() == "Windows":
       lo=["MS TCP Loopback interface","Loopback Pseudo-Interface 1"]
       needle="Loopback"
     else:
       lo="lo"
     s.collect_network_io(lo)
     self.assertTrue(s.db)
     for e in s.db:
         self.assertTrue(needle in e["name"])
Exemplo n.º 4
0
 def test_collect_network_whitelist(self):
     s = Statser()
     needle = "lo"
     if platform.system() == "Windows":
         lo = ["MS TCP Loopback interface", "Loopback Pseudo-Interface 1"]
         needle = "Loopback"
     else:
         lo = "lo"
     s.collect_network_io(lo)
     self.assertTrue(s.db)
     for e in s.db:
         self.assertTrue(needle in e["name"])
Exemplo n.º 5
0
    def test_collect_disk_usage_root(self):
        """
        test both, translation of the name / to root and the whitelist
        """
        s = Statser()
        needle="root"
        if platform.system() == "Windows":
          s.collect_disk_usage("C:\\\\")
          needle="C"
        else:
          s.collect_disk_usage("/")

        self.assertTrue(s.db)
        for e in s.db:
            self.assertTrue(needle in e["name"])
Exemplo n.º 6
0
    def test_collect_disk_usage_root(self):
        """
        test both, translation of the name / to root and the whitelist
        """
        s = Statser()
        needle = "root"
        if platform.system() == "Windows":
            s.collect_disk_usage("C:\\\\")
            needle = "C"
        else:
            s.collect_disk_usage("/")

        self.assertTrue(s.db)
        for e in s.db:
            self.assertTrue(needle in e["name"])
Exemplo n.º 7
0
 def test_collect_network(self):
     s = Statser()
     s.collect_network_io()
     self.assertTrue(s.db)
Exemplo n.º 8
0
 def test_collect_all(self):
     s = Statser()
     s.collect_all()
     self.assertTrue(s.db)
Exemplo n.º 9
0
 def test_clean(self):
     a = Statser()
     a.add_data("aids","balls")
     a.clean_db()
     self.assertFalse(a.db)
Exemplo n.º 10
0
 def test_collect_disk(self):
     s = Statser()
     s.collect_disk_io()
     self.assertTrue(s.db)
Exemplo n.º 11
0
 def test_collect_uptime(self):
     s = Statser()
     s.collect_uptime()
     self.assertTrue(s.db)
Exemplo n.º 12
0
 def test_collect_cpu_times(self):
     s = Statser()
     s.collect_cpu_times()
     self.assertTrue(s.db)
Exemplo n.º 13
0
 def test_collect_cpu_times(self):
     s = Statser()
     s.collect_cpu_times()
     self.assertTrue(s.db)
Exemplo n.º 14
0
 def test_collect_network(self):
     s = Statser()
     s.collect_network_io()
     self.assertTrue(s.db)
Exemplo n.º 15
0
 def test_clean(self):
     a = Statser()
     a.add_data("aids", "balls")
     a.clean_db()
     self.assertFalse(a.db)
Exemplo n.º 16
0
 def test_add_data(self):
     a = Statser()
     a.add_data("aids", "balls")
     self.assertTrue(a.db)
     self.assertEqual(a.db[0]["name"], "aids")
     self.assertEqual(a.db[0]["data"], "balls")
Exemplo n.º 17
0
 def test_collect_cpu_times(self):
     s = Statser()
     s.collect_cpu_times([0])
     self.assertTrue(s.db)
     for e in s.db:
         self.assertTrue("cpu0" in e["name"])
Exemplo n.º 18
0
 def test_collect_uptime(self):
     s = Statser()
     s.collect_uptime()
     self.assertTrue(s.db)
Exemplo n.º 19
0
 def test_collect_cpu_times(self):
     s = Statser()
     s.collect_cpu_times([0])
     self.assertTrue(s.db)
     for e in s.db:
         self.assertTrue("cpu0" in e["name"])
Exemplo n.º 20
0
 def test_collect_disk(self):
     s = Statser()
     s.collect_disk_io()
     self.assertTrue(s.db)
Exemplo n.º 21
0
 def test_collect_virtmem(self):
     s = Statser()
     s.collect_virtmem_usage()
     self.assertTrue(s.db)
Exemplo n.º 22
0
 def test_collect_virtmem(self):
     s = Statser()
     s.collect_virtmem_usage()
     self.assertTrue(s.db)
Exemplo n.º 23
0
 def test_collect_all(self):
     s = Statser()
     s.collect_all()
     self.assertTrue(s.db)
Exemplo n.º 24
0
 def test_add_data(self):
     a = Statser()
     a.add_data("aids","balls")
     self.assertTrue(a.db)
     self.assertEqual(a.db[0]["name"],"aids")
     self.assertEqual(a.db[0]["data"],"balls")