Skip to content

Commit

Permalink
Backport fix test snapshot save - 1.14.x (#18662)
Browse files Browse the repository at this point in the history
test: fix snapshot save w/ append test for ENT (#18656)

Co-authored-by: Dan Stough <dan.stough@hashicorp.com>
  • Loading branch information
absolutelightning and DanStough authored Sep 4, 2023
1 parent 7e563ef commit 54c7acf
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion command/snapshot/save/snapshot_save_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,20 @@ func TestSnapshotSaveCommandWithAppendFileNameFlag(t *testing.T) {
status = "leader"
}

newFilePath := filepath.Join(dir, "backup"+"-"+a.Config.Version+"-"+a.Config.Datacenter+
// We need to use the self endpoint here for ENT, which returns the product suffix (+ent)
self, err := client.Agent().Self()
require.NoError(t, err)

cfg, ok := self["Config"]
require.True(t, ok)

versionAny, ok := cfg["Version"]
require.True(t, ok)

version, ok := versionAny.(string)
require.True(t, ok)

newFilePath := filepath.Join(dir, "backup"+"-"+version+"-"+a.Config.Datacenter+
"-"+a.Config.NodeName+"-"+status+".tgz")

code := c.Run(args)
Expand Down

0 comments on commit 54c7acf

Please sign in to comment.