From bf9c5e6c6f61b728296c0e4ea2ae3e7239b9349e Mon Sep 17 00:00:00 2001 From: Jaap de Haan <261428+jdehaan@users.noreply.github.com> Date: Sat, 6 Dec 2025 10:51:27 +0000 Subject: [PATCH] feat: Suffix log path with "-sim" for simulations --- backup/internal/rsync_simulate.go | 2 +- backup/internal/test/rsync_test.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/backup/internal/rsync_simulate.go b/backup/internal/rsync_simulate.go index 8eaf951..ae1253c 100644 --- a/backup/internal/rsync_simulate.go +++ b/backup/internal/rsync_simulate.go @@ -12,7 +12,7 @@ func NewSimulateCommand(binPath string, logPath string) SimulateCommand { return SimulateCommand{ SharedCommand: SharedCommand{ BinPath: binPath, - BaseLogPath: logPath, + BaseLogPath: logPath + "-sim", Shell: &OsExec{}, }, } diff --git a/backup/internal/test/rsync_test.go b/backup/internal/test/rsync_test.go index c06e0d8..951ea1c 100644 --- a/backup/internal/test/rsync_test.go +++ b/backup/internal/test/rsync_test.go @@ -123,3 +123,12 @@ func TestGetVersionInfo_IncompletePath(t *testing.T) { assert.Empty(t, versionInfo) assert.Empty(t, fullpath) } + +func TestNewSimulateCommand_BaseLogPath_ShallHaveSimSuffix(t *testing.T) { + binPath := "/usr/bin/simulate" + logPath := "/var/log/simulate" + + simulateCmd := NewSimulateCommand(binPath, logPath) + + assert.Equal(t, logPath+"-sim", simulateCmd.BaseLogPath) +}