コード例 #1
0
 def testReadProcValid(self):
     # we need a procfs entry which exists on every system and
     # with a predictable value.
     threadsMax = ksm._readProcFSInt('/proc/sys/kernel/threads-max')
     # assertGreater would be better, but requires python 2.7
     # and python 2.6 is still around.
     self.assertTrue(threadsMax > 0)
コード例 #2
0
 def testReadProcNotInt(self):
     # what about unexpected content?
     self.assertEquals(ksm._readProcFSInt('/proc/version'), 0)
コード例 #3
0
 def testReadProcInexistent(self):
     # Do we deal correctly with not-existent paths?
     self.assertEquals(ksm._readProcFSInt('/proc/inexistent'), 0)