File: container_test.go

package info (click to toggle)
docker.io 28.5.2%2Bdfsg3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 68,176 kB
  • sloc: sh: 5,867; makefile: 863; ansic: 184; python: 162; asm: 159
file content (30 lines) | stat: -rw-r--r-- 529 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package convert

import (
	"testing"

	"gotest.tools/v3/assert"
)

func TestTmpfsOptionsToGRPC(t *testing.T) {
	options := [][]string{
		{"noexec"},
		{"uid", "12345"},
	}

	expected := `[["noexec"],["uid","12345"]]`
	actual := tmpfsOptionsToGRPC(options)
	assert.Equal(t, expected, actual)
}

func TestTmpfsOptionsFromGRPC(t *testing.T) {
	options := `[["noexec"],["uid","12345"]]`

	expected := [][]string{
		{"noexec"},
		{"uid", "12345"},
	}
	actual := tmpfsOptionsFromGRPC(options)

	assert.DeepEqual(t, expected, actual)
}