def test_backup_and_restore(self): """ Backup from gmvault_test and restore """ gsync_credential = {'type': 'passwd', 'value': self.gsync_passwd} gmvault_test_credential = { 'type': 'passwd', 'value': self.gmvault_test_passwd } test_utils.clean_mailbox(self.gsync_login, gsync_credential) gmvault_test_db_dir = "/tmp/backup-restore" backuper = gmvault.GMVaulter(gmvault_test_db_dir, 'imap.gmail.com', 993, \ self.gmvault_test_login, gmvault_test_credential, \ read_only_access = False) backuper.sync({'mode': 'full', 'type': 'imap', 'req': 'ALL'}) #check that we have x emails in the database restorer = gmvault.GMVaulter(gmvault_test_db_dir, 'imap.gmail.com', 993, \ self.gsync_login, gsync_credential, \ read_only_access = False) restorer.restore() #restore all emails from this essential-db test_utils.check_remote_mailbox_identical_to_local(self, restorer) test_utils.diff_online_mailboxes(backuper, restorer) gmvault_utils.delete_all_under(gmvault_test_db_dir, delete_top_dir=True)
def test_backup_and_restore(self): """backup from gmvault_test and restore""" gsync_credential = { 'type' : 'passwd', 'value': self.gsync_passwd } gmvault_test_credential = { 'type' : 'passwd', 'value': self.gmvault_test_passwd } test_utils.clean_mailbox(self.gsync_login, gsync_credential) gmvault_test_db_dir = "/tmp/backup-restore" backuper = gmvault.GMVaulter(gmvault_test_db_dir, 'imap.gmail.com', 993, \ self.gmvault_test_login, gmvault_test_credential, \ read_only_access = False) backuper.sync({ 'mode': 'full', 'type': 'imap', 'req': 'ALL' }) #check that we have x emails in the database restorer = gmvault.GMVaulter(gmvault_test_db_dir, 'imap.gmail.com', 993, \ self.gsync_login, gsync_credential, \ read_only_access = False) restorer.restore() #restore all emails from this essential-db test_utils.check_remote_mailbox_identical_to_local(self, restorer) test_utils.diff_online_mailboxes(backuper, restorer) gmvault_utils.delete_all_under(gmvault_test_db_dir, delete_top_dir = True)
def ztest_difference(self): """ """ gsync_credential = {'type': 'passwd', 'value': self.gsync_passwd} gmvault_test_credential = { 'type': 'passwd', 'value': self.gmvault_test_passwd } ba_credential = {'type': 'passwd', 'value': self.ba_passwd} gmv_dir_a = "/tmp/a-db" gmv_dir_b = "/tmp/b-db" gmv_a = gmvault.GMVaulter(gmv_dir_a, 'imap.gmail.com', 993, self.gsync_login, gsync_credential, read_only_access=True) #gmv_a = gmvault.GMVaulter(gmv_dir_a, 'imap.gmail.com', 993, self.gmvault_test_login, gmvault_test_credential, read_only_access = False) #gmv_b = gmvault.GMVaulter(gmv_dir_b, 'imap.gmail.com', 993, self.gmvault_test_login, gmvault_test_credential, read_only_access = False) #gmv_b = gmvault.GMVaulter(gmv_dir_b, 'imap.gmail.com', 993, self.ba_login, ba_credential, read_only_access = True) gmv_b = gmvault.GMVaulter(gmv_dir_b, 'imap.gmail.com', 993, self.ga_login, self.ga_cred, read_only_access=True) test_utils.diff_online_mailboxes(gmv_a, gmv_b)
def ztest_difference(self): """ """ gsync_credential = { 'type' : 'passwd', 'value': self.gsync_passwd } gmvault_test_credential = { 'type' : 'passwd', 'value': self.gmvault_test_passwd } ba_credential = { 'type' : 'passwd', 'value': self.ba_passwd } gmv_dir_a = "/tmp/a-db" gmv_dir_b = "/tmp/b-db" gmv_a = gmvault.GMVaulter(gmv_dir_a, 'imap.gmail.com', 993, self.gsync_login, gsync_credential, read_only_access = True) #gmv_a = gmvault.GMVaulter(gmv_dir_a, 'imap.gmail.com', 993, self.gmvault_test_login, gmvault_test_credential, read_only_access = False) #gmv_b = gmvault.GMVaulter(gmv_dir_b, 'imap.gmail.com', 993, self.gmvault_test_login, gmvault_test_credential, read_only_access = False) #gmv_b = gmvault.GMVaulter(gmv_dir_b, 'imap.gmail.com', 993, self.ba_login, ba_credential, read_only_access = True) gmv_b = gmvault.GMVaulter(gmv_dir_b, 'imap.gmail.com', 993, self.ga_login, self.ga_cred, read_only_access = True) test_utils.diff_online_mailboxes(gmv_a, gmv_b)