From b5a904408d2cad50b1155e5bd1104da308081af9 Mon Sep 17 00:00:00 2001 From: Ashesh Vidyut <134911583+absolutelightning@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:00:30 +0530 Subject: [PATCH] Backport 1.15 fix test snapshot save (#18663) test: fix snapshot save w/ append test for ENT (#18656) Co-authored-by: Dan Stough --- command/snapshot/save/snapshot_save_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/command/snapshot/save/snapshot_save_test.go b/command/snapshot/save/snapshot_save_test.go index 5d6e1a622a9c..40a75a7b9492 100644 --- a/command/snapshot/save/snapshot_save_test.go +++ b/command/snapshot/save/snapshot_save_test.go @@ -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)