Skip to content

Commit

Permalink
add test for etcd-snapshot delete on s3
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Cardoso <osodracnai@gmail.com>
  • Loading branch information
osodracnai committed Aug 2, 2023
1 parent a0da8ed commit 6900d81
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/e2e/s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ var _ = Describe("Verify Create", Ordered, func() {
Expect(res).To(ContainSubstring("special-2-server-0"))
Expect(res).To(ContainSubstring("special-3-server-0"))
})
It("delete first on-demand s3 snapshot", func() {
_, err := e2e.RunCmdOnNode("sudo k3s etcd-snapshot ls >> ./snapshotname.txt", serverNodeNames[0])
Expect(err).NotTo(HaveOccurred())
b, err := e2e.RunCmdOnNode("grep -Eo 'on-demand-server-0-([0-9]+)' ./snapshotname.txt | sed 's/^/on-demand-server-0-/'| head -1", serverNodeNames[0])
Expect(err).NotTo(HaveOccurred())
_, err = e2e.RunCmdOnNode("sudo k3s etcd-snapshot delete "+b, serverNodeNames[0])
Expect(err).NotTo(HaveOccurred())
})

// TODO, there is currently a bug that prevents pruning on s3 snapshots that are not prefixed with "on-demand"
// https://github.com/rancher/rke2/issues/3714
// Once fixed, ensure that the snapshots list are actually reduced to 2
Expand Down

0 comments on commit 6900d81

Please sign in to comment.