Exemple #1
0
    def test_create_submission_attach_files_finalize_and_verify_file_creation(self):
        self.submission_desc = yield self.get_dummy_submission(self.dummyContext['id'])
        receipt = yield self.create_submission_with_files(self.submission_desc)

        yield delivery.Delivery().run()

        self.fil = yield self.get_internalfiles_by_receipt(receipt)
        self.assertTrue(isinstance(self.fil, list))
        self.assertEqual(len(self.fil), 3)

        self.rfi = yield self.get_receiverfiles_by_receipt(receipt)
        self.assertTrue(isinstance(self.rfi, list))
        self.assertEqual(len(self.rfi), self.files_created)

        counters = {
            'encrypted': 0,
            'reference': 0
        }

        for i in range(self.files_created):
            if self.rfi[i]['status'] not in counters:
                counters[self.rfi[i]['status']] = 1
            else:
                counters[self.rfi[i]['status']] += 1

        for key in self.counters_check:
            self.assertEqual(counters[key], self.counters_check[key])
Exemple #2
0
    def setUp(self):
        yield helpers.TestHandlerWithPopulatedDB.setUp(self)
        yield self.perform_full_submission_actions()
        yield delivery.Delivery().run()

        for r in (yield tw(user.db_get_users, 1, 'receiver', 'en')):
            if r['pgp_key_fingerprint'] == 'BFB3C82D1B5F6A94BDAC55C6E70460ABF9A4C8C1':
                self.user = r
                return
Exemple #3
0
    def test_job(self):
        # verify that the system starts clean
        yield self.check0()

        yield self.perform_full_submission_actions()

        yield delivery.Delivery().run()

        # verify tip creation
        yield self.check1()

        yield cleaning.Cleaning().run()

        # verify tips survive the scheduler if they are not expired
        yield self.check1()

        yield self.force_wbtip_expiration()

        yield cleaning.Cleaning().run()

        # verify rtips survive the scheduler if the wbtip expires
        yield self.check2()

        yield self.set_itips_near_to_expire()

        yield cleaning.Cleaning().run()

        # verify mail creation and that rtips survive the scheduler
        yield self.check3()

        yield self.force_itip_expiration()

        yield cleaning.Cleaning().run()

        # verify cascade deletion when tips expire
        yield self.check4()

        # Make sure password resets actually happen
        State.tenant_cache[1]['password_change_period'] = 90
        yield self.set_passwords_ready_to_expire(1)
        yield cleaning.Cleaning().run()
        yield self.check5()
Exemple #4
0
    def test_job(self):
        # verify that the system starts clean
        yield self.check0()

        yield self.perform_full_submission_actions()

        yield delivery.Delivery().run()

        # verify tip creation
        yield self.check1()

        # mark files as uploaded on timestamp 0
        for f in os.listdir(Settings.attachments_path):
            path = os.path.join(Settings.attachments_path, f)
            os.utime(path,(0, 0))

        yield cleaning.Cleaning().run()

        # verify tips survive the scheduler if they are not expired
        yield self.check1()

        yield self.force_wbtip_expiration()

        yield cleaning.Cleaning().run()

        # verify rtips survive the scheduler if the wbtip expires
        yield self.check2()

        yield self.set_itips_near_to_expire()

        yield cleaning.Cleaning().run()

        # verify mail creation and that rtips survive the scheduler
        yield self.check3()

        yield self.force_itip_expiration()

        yield cleaning.Cleaning().run()

        # verify cascade deletion when tips expire
        yield self.check4()
Exemple #5
0
    def test_submission_life(self):
        # verify that the system starts clean
        yield self.check0()

        yield self.perform_full_submission_actions()

        yield delivery.Delivery().run()

        # verify tip creation
        yield self.check1()

        yield cleaning.Cleaning().run()

        # verify tips survive the scheduler if they are not expired
        yield self.check1()

        yield self.force_wbtip_expiration()

        yield cleaning.Cleaning().run()

        # verify rtips survive the scheduler if the wbtip expires
        yield self.check2()

        yield self.set_itips_near_to_expire()

        yield cleaning.Cleaning().run()

        # verify mail creation and that rtips survive the scheduler
        yield self.check3()

        yield self.force_itip_expiration()

        yield cleaning.Cleaning().run()

        # verify cascade deletion when tips expire
        yield self.check4()