Backport 1.16 fix test snapshot save (#18665)

test: fix snapshot save w/ append test for ENT (#18656)

Co-authored-by: Dan Stough <dan.stough@hashicorp.com>
This commit is contained in:
Ashesh Vidyut 2023-09-04 13:43:49 +05:30 committed by GitHub
parent 7ce902c8d3
commit d60d408c1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -101,7 +101,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)