Пример #1
0
 def test_asym_with_hidden_recipient_cycle(self):
     """Like test_basic_cycle but use asymmetric encryption (hidding key id) and signing"""
     backup_options = ["--hidden-encrypt-key " + helper.encrypt_key1,
                       "--sign-key " + helper.sign_key]
     restore_options = ["--hidden-encrypt-key " + helper.encrypt_key1,
                        "--sign-key " + helper.sign_key]
     helper.set_environ("SIGN_PASSPHRASE", helper.sign_passphrase)
     self.test_basic_cycle(backup_options = backup_options,
                           restore_options = restore_options)
Пример #2
0
    def run_duplicity(self, arglist, options = [], current_time = None):
        """
        Run duplicity binary with given arguments and options
        """
        options.append("--archive-dir testfiles/cache")
        # We run under setsid and take input from /dev/null (below) because
        # this way we force a failure if duplicity tries to read from the
        # console (like for gpg password or such).
        cmd_list = ["setsid", "duplicity"]
        cmd_list.extend(options + ["--allow-source-mismatch"])
        if current_time:
            cmd_list.append("--current-time %s" % (current_time,))
        if other_args:
            cmd_list.extend(other_args)
        cmd_list.extend(arglist)
        cmd_list.extend(["<", "/dev/null"])
        cmdline = " ".join(cmd_list)
        #print "Running '%s'." % cmdline
        helper.set_environ('PASSPHRASE', helper.sign_passphrase)
#        print "CMD: %s" % cmdline
        return_val = os.system(cmdline)
        if return_val:
            raise CmdError(os.WEXITSTATUS(return_val))
Пример #3
0
    def run_duplicity(self, arglist, options = [], current_time = None):
        """
        Run duplicity binary with given arguments and options
        """
        options.append("--archive-dir testfiles/cache")
        # We run under setsid and take input from /dev/null (below) because
        # this way we force a failure if duplicity tries to read from the
        # console (like for gpg password or such).
        cmd_list = ["setsid", "duplicity"]
        cmd_list.extend(options + ["--allow-source-mismatch"])
        if current_time:
            cmd_list.append("--current-time %s" % (current_time,))
        if other_args:
            cmd_list.extend(other_args)
        cmd_list.extend(self.class_args)
        cmd_list.extend(arglist)
        cmd_list.extend(["<", "/dev/null"])
        cmdline = " ".join(cmd_list)
        #print "Running '%s'." % cmdline
        helper.set_environ('PASSPHRASE', helper.sign_passphrase)
#        print "CMD: %s" % cmdline
        return_val = os.system(cmdline)
        if return_val:
            raise CmdError(os.WEXITSTATUS(return_val))
Пример #4
0
 def tearDown(self):
     helper.set_environ("PASSPHRASE", None)
     assert not os.system("rm -rf testfiles tempdir temp2.tar")
Пример #5
0
 def tearDown(self):
     helper.set_environ("PASSPHRASE", None)
     assert not os.system("rm -rf testfiles tempdir temp2.tar")