Skip to content

Commit

Permalink
Modify data test to not use default password (#356)
Browse files Browse the repository at this point in the history
* Modify data test to not use default password

* Update repo name
  • Loading branch information
DeepikaDixit authored and mergify[bot] committed Oct 13, 2019
1 parent 48d9504 commit 01666ce
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/function/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/kanisterio/kanister/pkg/objectstore"
"github.com/kanisterio/kanister/pkg/param"
"github.com/kanisterio/kanister/pkg/resource"
"github.com/kanisterio/kanister/pkg/restic"
"github.com/kanisterio/kanister/pkg/testutil"
)

Expand Down Expand Up @@ -588,15 +587,15 @@ func (s *DataSuite) TestDescribeBackupsWrongPassword(c *C) {

// Test backup
bp := *newBackupDataBlueprint()
bp.Actions["backup"].Phases[0].Args[BackupDataBackupArtifactPrefixArg] = fmt.Sprintf("%s/%s", bp.Actions["backup"].Phases[0].Args[BackupDataBackupArtifactPrefixArg], "abd")
bp.Actions["backup"].Phases[0].Args[BackupDataEncryptionKeyArg] = restic.GeneratePassword()
bp.Actions["backup"].Phases[0].Args[BackupDataBackupArtifactPrefixArg] = fmt.Sprintf("%s/%s", bp.Actions["backup"].Phases[0].Args[BackupDataBackupArtifactPrefixArg], "abcde")
bp.Actions["backup"].Phases[0].Args[BackupDataEncryptionKeyArg] = "foobar"
out := runAction(c, bp, "backup", tp)
c.Assert(out[BackupDataOutputBackupID].(string), Not(Equals), "")
c.Assert(out[BackupDataOutputBackupTag].(string), Not(Equals), "")

// Test DescribeBackups
bp2 := *newDescribeBackupsBlueprint()
bp2.Actions["describeBackups"].Phases[0].Args[DescribeBackupsArtifactPrefixArg] = fmt.Sprintf("%s/%s", bp2.Actions["describeBackups"].Phases[0].Args[DescribeBackupsArtifactPrefixArg], "abd")
bp2.Actions["describeBackups"].Phases[0].Args[DescribeBackupsArtifactPrefixArg] = fmt.Sprintf("%s/%s", bp2.Actions["describeBackups"].Phases[0].Args[DescribeBackupsArtifactPrefixArg], "abcde")
out2 := runAction(c, bp2, "describeBackups", tp)
c.Assert(out2[DescribeBackupsPasswordIncorrect].(string), Equals, "true")
}
Expand All @@ -612,7 +611,7 @@ func (s *DataSuite) TestDescribeBackupsRepoNotAvailable(c *C) {

// Test DescribeBackups
bp2 := *newDescribeBackupsBlueprint()
bp2.Actions["describeBackups"].Phases[0].Args[DescribeBackupsArtifactPrefixArg] = fmt.Sprintf("%s/%s", bp2.Actions["describeBackups"].Phases[0].Args[DescribeBackupsArtifactPrefixArg], "foobar")
bp2.Actions["describeBackups"].Phases[0].Args[DescribeBackupsArtifactPrefixArg] = fmt.Sprintf("%s/%s", bp2.Actions["describeBackups"].Phases[0].Args[DescribeBackupsArtifactPrefixArg], c.TestName())
out2 := runAction(c, bp2, "describeBackups", tp)
c.Assert(out2[DescribeBackupsRepoDoesNotExist].(string), Equals, "true")
}

0 comments on commit 01666ce

Please sign in to comment.