Skip to content

Commit 29b588a

Browse files
Copilotpelikhan
andcommitted
Add integration tests for absolute path validation in mount specifications
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 1d6bdff commit 29b588a

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

internal/config/config_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,26 @@ func TestLoadFromStdin_InvalidMountFormat(t *testing.T) {
802802
mounts: `["/host::ro"]`,
803803
errorMsg: "validation error",
804804
},
805+
{
806+
name: "relative source path",
807+
mounts: `["relative/path:/container:ro"]`,
808+
errorMsg: "mount source must be an absolute path",
809+
},
810+
{
811+
name: "relative destination path",
812+
mounts: `["/host:relative/path:ro"]`,
813+
errorMsg: "mount destination must be an absolute path",
814+
},
815+
{
816+
name: "dot relative source",
817+
mounts: `["./config:/app/config:ro"]`,
818+
errorMsg: "mount source must be an absolute path",
819+
},
820+
{
821+
name: "dot relative destination",
822+
mounts: `["/host/config:./config:ro"]`,
823+
errorMsg: "mount destination must be an absolute path",
824+
},
805825
}
806826

807827
for _, tt := range tests {

0 commit comments

Comments
 (0)