Skip to content

Commit 5f2434a

Browse files
committed
Rebase on fix-invalid-flag
1 parent 2a44c3c commit 5f2434a

File tree

8 files changed

+33
-36
lines changed

8 files changed

+33
-36
lines changed

test/e2e/auto-backup/daemonset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var _ = Describe("Auto-Backup", func() {
5353
return map[string]string{
5454
v1beta1.KeyBackupBlueprint: backupBlueprintName,
5555
v1beta1.KeyTargetPaths: framework.TestSourceDataTargetPath,
56-
v1beta1.KeyVolumeMounts: framework.TestSourceDataVolumeMount,
56+
v1beta1.KeyVolumeMounts: framework.TestSourceVolumeAndMount,
5757
}
5858
}
5959

test/e2e/auto-backup/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var _ = Describe("Auto-Backup", func() {
5353
return map[string]string{
5454
v1beta1.KeyBackupBlueprint: backupBlueprintName,
5555
v1beta1.KeyTargetPaths: framework.TestSourceDataTargetPath,
56-
v1beta1.KeyVolumeMounts: framework.TestSourceDataVolumeMount,
56+
v1beta1.KeyVolumeMounts: framework.TestSourceVolumeAndMount,
5757
}
5858
}
5959

test/e2e/auto-backup/replicaset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var _ = Describe("Auto-Backup", func() {
5353
return map[string]string{
5454
v1beta1.KeyBackupBlueprint: backupBlueprintName,
5555
v1beta1.KeyTargetPaths: framework.TestSourceDataTargetPath,
56-
v1beta1.KeyVolumeMounts: framework.TestSourceDataVolumeMount,
56+
v1beta1.KeyVolumeMounts: framework.TestSourceVolumeAndMount,
5757
}
5858
}
5959

test/e2e/auto-backup/replicationcontroller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var _ = Describe("Auto-Backup", func() {
5353
return map[string]string{
5454
v1beta1.KeyBackupBlueprint: backupBlueprintName,
5555
v1beta1.KeyTargetPaths: framework.TestSourceDataTargetPath,
56-
v1beta1.KeyVolumeMounts: framework.TestSourceDataVolumeMount,
56+
v1beta1.KeyVolumeMounts: framework.TestSourceVolumeAndMount,
5757
}
5858
}
5959

test/e2e/auto-backup/statefulset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var _ = Describe("Auto-Backup", func() {
5353
return map[string]string{
5454
v1beta1.KeyBackupBlueprint: backupBlueprintName,
5555
v1beta1.KeyTargetPaths: framework.TestSourceDataTargetPath,
56-
v1beta1.KeyVolumeMounts: framework.TestSourceDataVolumeMount,
56+
v1beta1.KeyVolumeMounts: framework.TestSourceVolumeAndMount,
5757
}
5858
}
5959

test/e2e/e2e_suite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
"stash.appscode.dev/stash/test/e2e/framework"
3333
_ "stash.appscode.dev/stash/test/e2e/hooks"
3434
_ "stash.appscode.dev/stash/test/e2e/miscellaneous-use-cases"
35-
_ "stash.appscode.dev/stash/test/e2e/general"
3635
_ "stash.appscode.dev/stash/test/e2e/volumes"
3736
_ "stash.appscode.dev/stash/test/e2e/workloads"
3837

test/e2e/framework/util.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ var (
5656
)
5757

5858
const (
59-
TestSoucreDemoDataPath = "/data/stash-test/demo-data"
60-
TestSourceDataDir1 = "/source/data/dir-1"
61-
TestSourceDataDir2 = "/source/data/dir-2"
62-
KindRestic = "Restic"
63-
KindRepository = "Repository"
64-
KindRecovery = "Recovery"
65-
PullInterval = time.Second * 2
66-
WaitTimeOut = time.Minute * 3
67-
TaskPVCBackup = "pvc-backup"
68-
TaskPVCRestore = "pvc-restore"
69-
TestSourceDataTargetPath = "/source/data"
70-
TestSourceDataVolumeMount = "source-data:/source/data"
71-
WrongBackupBlueprintName = "backup-blueprint"
72-
WrongTargetPath = "/source/data-1"
59+
TestSoucreDemoDataPath = "/data/stash-test/demo-data"
60+
TestSourceDataDir1 = "/source/data/dir-1"
61+
TestSourceDataDir2 = "/source/data/dir-2"
62+
KindRestic = "Restic"
63+
KindRepository = "Repository"
64+
KindRecovery = "Recovery"
65+
PullInterval = time.Second * 2
66+
WaitTimeOut = time.Minute * 3
67+
TaskPVCBackup = "pvc-backup"
68+
TaskPVCRestore = "pvc-restore"
69+
TestSourceDataTargetPath = "/source/data"
70+
TestSourceVolumeAndMount = SourceVolume + ":" + TestSourceDataMountPath
71+
WrongBackupBlueprintName = "backup-blueprint"
72+
WrongTargetPath = "/source/data-1"
7373

7474
SourceDeployment = "source-dp"
7575
RestoredDeployment = "restored-dp"

test/e2e/general/repository.go renamed to test/e2e/miscellaneous-use-cases/repository.go

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
package general
16+
package miscellaneous_use_cases
1717

1818
import (
1919
"fmt"
@@ -39,6 +39,10 @@ var _ = Describe("Repository", func() {
3939
f = framework.NewInvocation()
4040
})
4141

42+
JustAfterEach(func() {
43+
f.PrintDebugInfoOnFailure()
44+
})
45+
4246
AfterEach(func() {
4347
err := f.CleanupTestResources()
4448
Expect(err).NotTo(HaveOccurred())
@@ -48,7 +52,7 @@ var _ = Describe("Repository", func() {
4852
Context("Invalid MountPath", func() {
4953
It("should reject to create Repository for using `/stash` as `mountPath`", func() {
5054
// Deploy a Deployment
51-
_, err := f.DeployDeployment(fmt.Sprintf("source-deployment1-%s", f.App()), int32(1))
55+
_, err := f.DeployDeployment(framework.SourceDeployment, int32(1), framework.SourceVolume)
5256
Expect(err).NotTo(HaveOccurred())
5357

5458
// Create Storage Secret
@@ -59,11 +63,11 @@ var _ = Describe("Repository", func() {
5963
f.AppendToCleanupList(&cred)
6064

6165
// We are going to use an PVC as backend
62-
pvc, err := f.CreateNewPVC(rand.WithUniqSuffix("pvc"))
66+
pvc, err := f.CreateNewPVC(rand.WithUniqSuffix("backend-pvc"))
6367
Expect(err).NotTo(HaveOccurred())
6468

6569
// Generate Repository Definition
66-
repo := f.NewLocalRepository(cred.Name, pvc.Name)
70+
repo := f.NewLocalRepositoryWithPVC(cred.Name, pvc.Name)
6771

6872
// Use `/stash` as `mountPath`
6973
repo.Spec.Backend.Local.MountPath = "/stash"
@@ -72,12 +76,11 @@ var _ = Describe("Repository", func() {
7276
By("reject to create Repository")
7377
_, err = f.StashClient.StashV1alpha1().Repositories(repo.Namespace).Create(repo)
7478
Expect(err).To(HaveOccurred())
75-
7679
})
7780

7881
It("should reject to create Repository for using `/stash/data` as `mountPath`", func() {
7982
// Deploy a Deployment
80-
_, err := f.DeployDeployment(fmt.Sprintf("source-deployment1-%s", f.App()), int32(1))
83+
_, err := f.DeployDeployment(framework.SourceDeployment, int32(1), framework.SourceVolume)
8184
Expect(err).NotTo(HaveOccurred())
8285

8386
// Create Storage Secret
@@ -88,11 +91,11 @@ var _ = Describe("Repository", func() {
8891
f.AppendToCleanupList(&cred)
8992

9093
// We are going to use an PVC as backend
91-
pvc, err := f.CreateNewPVC(rand.WithUniqSuffix("pvc"))
94+
pvc, err := f.CreateNewPVC(rand.WithUniqSuffix("backend-pvc"))
9295
Expect(err).NotTo(HaveOccurred())
9396

9497
// Generate Repository Definition
95-
repo := f.NewLocalRepository(cred.Name, pvc.Name)
98+
repo := f.NewLocalRepositoryWithPVC(cred.Name, pvc.Name)
9699

97100
// Use `/stash` as `mountPath`
98101
repo.Spec.Backend.Local.MountPath = "/stash/data"
@@ -101,17 +104,15 @@ var _ = Describe("Repository", func() {
101104
By("reject to create Repository")
102105
_, err = f.StashClient.StashV1alpha1().Repositories(repo.Namespace).Create(repo)
103106
Expect(err).To(HaveOccurred())
104-
105107
})
106108
})
107109

108110
Context("Invalid MountPath in Auto-Backup", func() {
109-
110111
annotations := func(backupBlueprintName string) map[string]string {
111112
return map[string]string{
112113
v1beta1.KeyBackupBlueprint: backupBlueprintName,
113114
v1beta1.KeyTargetPaths: framework.TestSourceDataTargetPath,
114-
v1beta1.KeyVolumeMounts: framework.TestSourceDataVolumeMount,
115+
v1beta1.KeyVolumeMounts: framework.TestSourceVolumeAndMount,
115116
}
116117
}
117118

@@ -123,7 +124,7 @@ var _ = Describe("Repository", func() {
123124
f.AppendToCleanupList(&cred)
124125

125126
// We are going to use an PVC as backend
126-
pvc, err := f.CreateNewPVC(rand.WithUniqSuffix("pvc"))
127+
pvc, err := f.CreateNewPVC(rand.WithUniqSuffix("backend-pvc"))
127128
Expect(err).NotTo(HaveOccurred())
128129

129130
// Generate BackupBlueprint definition
@@ -143,7 +144,7 @@ var _ = Describe("Repository", func() {
143144
f.AppendToCleanupList(createdBB)
144145

145146
// Deploy a DaemonSet
146-
deployment, err := f.DeployDeployment(fmt.Sprintf("deployment-%s", f.App()), int32(1))
147+
deployment, err := f.DeployDeployment(framework.SourceDeployment, int32(1), framework.SourceVolume)
147148
Expect(err).NotTo(HaveOccurred())
148149

149150
// Add auto-backup annotations to Target
@@ -152,10 +153,7 @@ var _ = Describe("Repository", func() {
152153

153154
// AutoBackup Resource creation failed
154155
f.EventuallyEvent(deployment.ObjectMeta, apis.KindDeployment).Should(matcher.HaveEvent(eventer.EventReasonAutoBackupResourcesCreationFailed))
155-
156156
})
157157
})
158-
159158
})
160-
161159
})

0 commit comments

Comments
 (0)