mirror of
https://github.com/containers/podman.git
synced 2025-05-31 15:42:48 +08:00

These files should never be included on the remote client. There only there to finalize the spec on the server side. This makes sure it will not get reimported by accident and bloat the remote client again. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
32 lines
715 B
Go
32 lines
715 B
Go
//go:build !remote
|
|
// +build !remote
|
|
|
|
package generate
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestShouldMask(t *testing.T) {
|
|
tests := []struct {
|
|
mask string
|
|
unmask []string
|
|
shouldMask bool
|
|
}{
|
|
{"/proc/foo", []string{"all"}, false},
|
|
{"/proc/foo", []string{"ALL"}, false},
|
|
{"/proc/foo", []string{"/proc/foo"}, false},
|
|
{"/proc/foo", []string{"/proc/*"}, false},
|
|
{"/proc/foo", []string{"/proc/bar", "all"}, false},
|
|
{"/proc/foo", []string{"/proc/f*"}, false},
|
|
{"/proc/foo", []string{"/proc/b*"}, true},
|
|
{"/proc/foo", []string{}, true},
|
|
}
|
|
for _, test := range tests {
|
|
val := shouldMask(test.mask, test.unmask)
|
|
assert.Equal(t, val, test.shouldMask)
|
|
}
|
|
}
|