Skip to content

Commit 2bac975

Browse files
committed
add test
1 parent ec1a81a commit 2bac975

File tree

3 files changed

+2101
-0
lines changed

3 files changed

+2101
-0
lines changed

internal/namespaces/instance/v1/custom_server_action_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ func Test_ServerBackup(t *testing.T) {
114114
core.ExecAfterCmd("scw instance server delete {{ .Server.ID }} with-ip=true with-volumes=local"),
115115
),
116116
}))
117+
118+
t.Run("With SBS volumes", core.Test(&core.TestConfig{
119+
Commands: instance.GetCommands(),
120+
BeforeFunc: core.ExecStoreBeforeCmd("Server", testServerCommand("root-volume=sbs:20G stopped=true image=ubuntu-jammy")),
121+
Cmd: `scw instance server backup {{ .Server.ID }} name=backup`,
122+
Check: core.TestCheckCombine(
123+
core.TestCheckGolden(),
124+
core.TestCheckExitCode(0),
125+
),
126+
AfterFunc: core.AfterFuncCombine(
127+
core.ExecAfterCmd("scw instance image delete {{ .CmdResult.Image.ID }} with-snapshots=true"),
128+
core.ExecAfterCmd("scw instance server delete {{ .Server.ID }} with-ip=true with-volumes=local"),
129+
),
130+
}))
117131
}
118132

119133
func Test_ServerAction(t *testing.T) {

0 commit comments

Comments
 (0)