mirror of
https://github.com/restic/restic.git
synced 2025-08-22 06:21:10 +00:00
backup: test subdirectories in stdin filenames work
This commit is contained in:
@@ -632,12 +632,15 @@ func TestStdinFromCommand(t *testing.T) {
|
|||||||
|
|
||||||
testSetupBackupData(t, env)
|
testSetupBackupData(t, env)
|
||||||
opts := BackupOptions{
|
opts := BackupOptions{
|
||||||
StdinCommand: true,
|
StdinCommand: true,
|
||||||
StdinFilename: "stdin",
|
// test that subdirectories are handled correctly
|
||||||
|
StdinFilename: "stdin/subdir/file",
|
||||||
}
|
}
|
||||||
|
|
||||||
testRunBackup(t, filepath.Dir(env.testdata), []string{"python", "-c", "import sys; print('something'); sys.exit(0)"}, opts, env.gopts)
|
testRunBackup(t, filepath.Dir(env.testdata), []string{"python", "-c", "import sys; print('something'); sys.exit(0)"}, opts, env.gopts)
|
||||||
testListSnapshots(t, env.gopts, 1)
|
snapshots := testListSnapshots(t, env.gopts, 1)
|
||||||
|
files := testRunLs(t, env.gopts, snapshots[0].String())
|
||||||
|
rtest.Assert(t, includes(files, "/stdin/subdir/file"), "file %q missing from snapshot, got %v", "stdin/subdir/file", files)
|
||||||
|
|
||||||
testRunCheck(t, env.gopts)
|
testRunCheck(t, env.gopts)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user