add named named state delete+create-delete test
This ensures that we don't leave any conflicting state artifacts preventing the recreation of a named state.
This commit is contained in:
parent
c80a21610d
commit
ebf4413e95
|
@ -187,6 +187,24 @@ func testBackendStates(t *testing.T, b Backend) {
|
||||||
t.Fatal("expected error")
|
t.Fatal("expected error")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create and delete the foo state again.
|
||||||
|
// Make sure that there are no leftover artifacts from a deleted state
|
||||||
|
// preventing re-creation.
|
||||||
|
foo, err = b.State("foo")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("error: %s", err)
|
||||||
|
}
|
||||||
|
if err := foo.RefreshState(); err != nil {
|
||||||
|
t.Fatalf("bad: %s", err)
|
||||||
|
}
|
||||||
|
if v := foo.State(); v.HasResources() {
|
||||||
|
t.Fatalf("should be empty: %s", v)
|
||||||
|
}
|
||||||
|
// and delete it again
|
||||||
|
if err := b.DeleteState("foo"); err != nil {
|
||||||
|
t.Fatalf("err: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Verify deletion
|
// Verify deletion
|
||||||
{
|
{
|
||||||
states, err := b.States()
|
states, err := b.States()
|
||||||
|
|
Loading…
Reference in New Issue