Exemple #1
0
    def test_dups(self):
        history.start_run()
        history.report_missing(self.missing)
        history.report_orphan(self.missing + self.missing2)
        history.finish_run()

        self.assertEqual(history.orphan_files('TEST_SITE_NAME'),
                         sorted([miss[0] for miss in self.missing2]))
Exemple #2
0
    def test_orphan(self):
        history.start_run()
        history.report_orphan(self.missing)
        history.finish_run()

        self.assertEqual(history.orphan_files(history.config.SITE),
                         sorted([miss[0] for miss in self.missing]))

        self.assertFalse(history.missing_files(history.config.SITE))
Exemple #3
0
    def test_othersite(self):
        dynamo_consistency.opts.MORELOGS = True
        config.config_dict()
        config.CONFIG['AdditionalLogDeletions']['TEST_SITE2'] = config.CONFIG['AdditionalLogDeletions'].pop('TEST_SITE')
        site = picker.pick_site()

        main.main(site)
        self.assertTrue(history.orphan_files(site))
        unmerged = history.unmerged_files(site)
        self.assertFalse('/store/logs/prod/recent/test.tar.gz' in unmerged)
        self.assertFalse('/store/logs/prod/nope/test.tar.gz' in unmerged)
Exemple #4
0
    def test_main(self):
        main.main(picker.pick_site())

        self.assertFalse(history.RUN)

        # See dynamo_consistency.backend.test for expected results

        self.assertEqual(history.missing_files(main.config.SITE),
                         ['/store/data/runB/0003/missing.root'])
        self.assertEqual(history.orphan_files(main.config.SITE),
                         ['/store/data/runB/0001/orphan.root'])
        self.assertEqual(history.empty_directories(main.config.SITE), [
            '/store/data/runC/0000/emtpy/dir', '/store/data/runC/0000/emtpy',
            '/store/data/runC/0000', '/store/data/runC'
        ])
Exemple #5
0
#! /usr/bin/env python

from dynamo_consistency import history

if __name__ == '__main__':
    if len(history.orphan_files('T3_US_MIT')) != 2:
        exit (1)
    if len(history.missing_files('T3_US_MIT')):
        exit (2)
Exemple #6
0
 def test_removed(self):
     # Note that there's no RAW file here to delete
     self.assertEqual(history.orphan_files(main.config.SITE),
                      ['/store/mc/ttThings/0000/orphan.root'])