mirror of
https://github.com/opencontainers/runc.git
synced 2026-05-01 12:06:07 +08:00
libct/configs/validate: allow / in sysctl names
Runtime spec says: > sysctl (object, OPTIONAL) allows kernel parameters to be modified at > runtime for the container. For more information, see the sysctl(8) > man page. and sysctl(8) says: > variable > The name of a key to read from. An example is > kernel.ostype. The '/' separator is also accepted in place of a '.'. Apparently, runc config validator do not support sysctls with / as a separator. Fortunately this is a one-line fix. Add some more test data where / is used as a separator. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -188,8 +188,11 @@ func TestValidateUsernamespaceWithoutUserNS(t *testing.T) {
|
||||
func TestValidateSysctl(t *testing.T) {
|
||||
sysctl := map[string]string{
|
||||
"fs.mqueue.ctl": "ctl",
|
||||
"fs/mqueue/ctl": "ctl",
|
||||
"net.ctl": "ctl",
|
||||
"net/ctl": "ctl",
|
||||
"kernel.ctl": "ctl",
|
||||
"kernel/ctl": "ctl",
|
||||
}
|
||||
|
||||
for k, v := range sysctl {
|
||||
@@ -209,8 +212,11 @@ func TestValidateSysctl(t *testing.T) {
|
||||
func TestValidateValidSysctl(t *testing.T) {
|
||||
sysctl := map[string]string{
|
||||
"fs.mqueue.ctl": "ctl",
|
||||
"fs/mqueue/ctl": "ctl",
|
||||
"net.ctl": "ctl",
|
||||
"net/ctl": "ctl",
|
||||
"kernel.msgmax": "ctl",
|
||||
"kernel/msgmax": "ctl",
|
||||
}
|
||||
|
||||
for k, v := range sysctl {
|
||||
|
||||
Reference in New Issue
Block a user