From 70c55f605704d24aea096c0767923e5f6d4981f0 Mon Sep 17 00:00:00 2001 From: John Garbutt Date: Tue, 10 Sep 2019 13:47:51 +0100 Subject: [PATCH] Add test of environment variable escape in rsync --- internal/pkg/filesystem_impl/copy_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/pkg/filesystem_impl/copy_test.go b/internal/pkg/filesystem_impl/copy_test.go index 5f6d14d5..f3240579 100644 --- a/internal/pkg/filesystem_impl/copy_test.go +++ b/internal/pkg/filesystem_impl/copy_test.go @@ -70,4 +70,11 @@ func Test_GenerateRsyncCmd(t *testing.T) { cmd, err = generateRsyncCmd(testVolume, request) assert.Equal(t, "", cmd) assert.Equal(t, "unsupported source type list for volume: asdf", err.Error()) + + request.SourceType = datamodel.File + request.Source = "$DW_test" + request.Destination = "dest" + cmd, err = generateRsyncCmd(testVolume, request) + assert.Nil(t, err) + assert.Equal(t, "rsync -ospgu --stats \\$DW_test dest", cmd) }