Use IsRestrictedVolume from runner-go
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/drone-runners/drone-runner-docker/engine"
|
||||
"github.com/drone-runners/drone-runner-docker/engine/resource"
|
||||
|
||||
"github.com/drone/runner-go/manifest"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
@@ -198,23 +199,3 @@ func Test_removeCloneDeps_CloneEnabled(t *testing.T) {
|
||||
t.Log(diff)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsRestricedVolume(t *testing.T) {
|
||||
tests := map[string]bool{
|
||||
"/var/run": true,
|
||||
"//var/run": true,
|
||||
"/var/run/": true,
|
||||
"/var/run/.": true,
|
||||
"/var/run//": true,
|
||||
"/var/run/test/..": true,
|
||||
"/var/./run": true,
|
||||
"/": true,
|
||||
"/drone": false,
|
||||
"/drone/var/run": false,
|
||||
}
|
||||
for path, ok := range tests {
|
||||
if got, want := isRestrictedVolume(path), ok; got != want {
|
||||
t.Errorf("Want restriced %v for path %q", want, path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user