summaryrefslogtreecommitdiff
path: root/cmd/podman/shared/create_cli_test.go
blob: a045962cba59094812d5bf6e4d44ca9df153fea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package shared

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestValidateSysctl(t *testing.T) {
	strSlice := []string{"net.core.test1=4", "kernel.msgmax=2"}
	result, _ := validateSysctl(strSlice)
	assert.Equal(t, result["net.core.test1"], "4")
}

func TestValidateSysctlBadSysctl(t *testing.T) {
	strSlice := []string{"BLAU=BLUE", "GELB^YELLOW"}
	_, err := validateSysctl(strSlice)
	assert.Error(t, err)
}