def testBasic(self):
        self.setupStep(RemoveWorkerFileSecret([
            (os.path.join(self.temp_path, "pathA"), "something"),
            (os.path.join(self.temp_path, "pathB"), "somethingmore")
        ]),
                       worker_version={'*': '3.0'})

        args1 = {
            'path': os.path.join(self.temp_path, "pathA"),
            'dir': os.path.abspath(os.path.join(self.temp_path, "pathA")),
            'logEnviron': False
        }
        args2 = {
            'path': os.path.join(self.temp_path, "pathB"),
            'dir': os.path.abspath(os.path.join(self.temp_path, "pathB")),
            'logEnviron': False
        }
        self.expectCommands(
            Expect('rmdir', args1) + 0,
            Expect('rmdir', args2) + 0,
        )

        self.expectOutcome(result=SUCCESS, state_string="finished")
        d = self.runStep()
        return d
Exemple #2
0
 def addSteps(self, steps, withSecrets=[]):
     if withSecrets:
         self.addStep(DownloadSecretsToWorker(withSecrets))
     for s in steps:
         self.addStep(s)
     if withSecrets:
         self.addStep(RemoveWorkerFileSecret(withSecrets))
    def testBasic(self):
        self.setup_step(
            RemoveWorkerFileSecret([(os.path.join(self.temp_path, "pathA"), "something"),
                                    (os.path.join(self.temp_path, "pathB"), "somethingmore")]))
        self.expect_commands(
            ExpectRmfile(path=os.path.join(self.temp_path, "pathA"), log_environ=False)
            .exit(0),
            ExpectRmfile(path=os.path.join(self.temp_path, "pathB"), log_environ=False)
            .exit(0),
            )

        self.expect_outcome(
            result=SUCCESS, state_string="finished")
        d = self.run_step()
        return d
Exemple #4
0
    def testBasic(self):
        self.setupStep(
            RemoveWorkerFileSecret([(os.path.join(self.temp_path, "pathA")),
                                    (os.path.join(self.temp_path, "pathB"))]))
        args1 = {
                    'path': os.path.join(self.temp_path, "pathA"),
                    'logEnviron': False
                    }
        args2 = {
                    'path': os.path.join(self.temp_path, "pathB"),
                    'logEnviron': False
                    }
        self.expectCommands(
            Expect('rmfile', args1)
            + 0,
            Expect('rmfile', args2)
            + 0,
            )

        self.expectOutcome(
            result=SUCCESS, state_string="finished")
        d = self.runStep()
        return d
Exemple #5
0
 def withSecrets(self, secrets):
     self.addStep(DownloadSecretsToWorker(secrets))
     yield self
     self.addStep(RemoveWorkerFileSecret(secrets))