Пример #1
0
    def testSpiff679(self):
        with open('spiff.dd.679.out') as f:
            expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
        with open('spiff.dd', 'rb') as f:
            actual = tsk_helper.strip_all(istat_fat16.istat_fat16(f, 679, offset=2))

        self.assertEqual(expected, actual)
Пример #2
0
    def testAdams5(self):
        with open('adams.dd.5.out') as f:
            expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
        with open('adams.dd', 'rb') as f:
            actual = tsk_helper.strip_all(istat_fat16.istat_fat16(f, 5))

        self.assertEqual(expected, actual)
Пример #3
0
    def testFragmented7(self):
        with open('fragmented.dd.7.out') as f:
            expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
        with open('fragmented.dd', 'rb') as f:
            actual = tsk_helper.strip_all(istat_fat16.istat_fat16(f, 7, 1024))

        self.assertEqual(expected, actual)
Пример #4
0
 def testAdams(self):
     self.maxDiff = None
     with open('adams.dd.fsstat.out') as f:
         expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
     with open('adams.dd', 'rb') as f:
         actual = tsk_helper.strip_all(fsstat_fat16.fsstat_fat16(f))
     self.assertEqual(expected, actual)
Пример #5
0
 def testImage70(self):
     with open('image.ntfs.70.out') as f:
         expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
     with open('image.ntfs', 'rb') as f:
         actual = tsk_helper.strip_all(istat_ntfs.istat_ntfs(f, 70))
     if len(expected) != len(actual):
         self.fail()
     self.assertEqual(expected, actual)
Пример #6
0
 def testSimple(self):
     with open('simple.ntfs.64.out') as f:
         expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
     with open('simple.ntfs', 'rb') as f:
         actual = tsk_helper.strip_all(istat_ntfs.istat_ntfs(f, 64))
     if len(expected) != len(actual):
         self.fail()
     self.assertEqual(expected, actual)
Пример #7
0
 def testMM(self):
     with open('MM.iso.out') as f:
         expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
     with open('MM.iso', 'rb') as f:
         actual = tsk_helper.strip_all(fsstat_iso9660.fsstat_iso9660(f))
     if len(expected) != len(actual):
         self.fail()
     self.assertEqual(expected, actual)
Пример #8
0
 def testAdams(self):
     with open('adams.dd.fsstat.out') as f:
         expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
     with open('adams.dd', 'rb') as f:
         actual = tsk_helper.strip_all(fsstat_fat16.fsstat_fat16(f))
         for line in actual:
             print(line)
     self.assertEqual(expected, actual)
Пример #9
0
 def testImage65(self):
     self.maxDiff = None
     with open('image.ntfs.65.out') as f:
         expected = tsk_helper.strip_all(tsk_helper.get_fsstat_output(f))
     with open('image.ntfs', 'rb') as f:
         actual = tsk_helper.strip_all(istat_ntfs.istat_ntfs(f, 65))
     # if len(expected) != len(actual):
     #     self.fail()
     self.assertEqual(expected, actual)
Пример #10
0
 def testSpiff(self):
     expected = subprocess.check_output(["fsstat","-o", "2", "spiff.dd"])
     with open('spiff.dd.expected', 'w') as f:
         f.write(expected.decode())
     with open('spiff.dd', 'rb') as f:
         actual = tsk_helper.strip_all(fsstat_fat16.fsstat_fat16(f,offset=2))
     with open('spiff.dd.output', 'w') as f:
         f.write("\n".join(actual))
     self.failureException(expected,actual)
Пример #11
0
 def testFragmented(self):
     expected = subprocess.check_output(["fsstat", "fragmented.dd"])
     with open('fragmented.dd.expected', 'w') as f:
         f.write(expected.decode())
     with open('fragmented.dd', 'rb') as f:
         actual = tsk_helper.strip_all(fsstat_fat16.fsstat_fat16(f,1024))
     with open('fragmented.dd.output', 'w') as f:
         f.write("\n".join(actual))
     self.failureException(expected,actual)