mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +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>
33 lines
718 B
Go
33 lines
718 B
Go
//go:build !remote
|
|
// +build !remote
|
|
|
|
package generate
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestParseDevice(t *testing.T) {
|
|
tests := []struct {
|
|
device string
|
|
src string
|
|
dst string
|
|
perm string
|
|
}{
|
|
{"/dev/foo", "/dev/foo", "/dev/foo", "rwm"},
|
|
{"/dev/foo:/dev/bar", "/dev/foo", "/dev/bar", "rwm"},
|
|
{"/dev/foo:/dev/bar:rw", "/dev/foo", "/dev/bar", "rw"},
|
|
{"/dev/foo:rw", "/dev/foo", "/dev/foo", "rw"},
|
|
{"/dev/foo::rw", "/dev/foo", "/dev/foo", "rw"},
|
|
}
|
|
for _, test := range tests {
|
|
src, dst, perm, err := ParseDevice(test.device)
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, src, test.src)
|
|
assert.Equal(t, dst, test.dst)
|
|
assert.Equal(t, perm, test.perm)
|
|
}
|
|
}
|