Improve support of sysctl name seprators

Sysctl names can use dots or slashes as separator:

- if dots are used, dots and slashes are interchanged.
- if slashes are used, slashes and dots are left intact.

Separator in use is determined by firt ocurrence.

Reference: http://man7.org/linux/man-pages/man5/sysctl.d.5.html

Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
This commit is contained in:
Jaime Caamaño Ruiz
2020-01-13 14:40:42 +01:00
parent 62b36d2fbc
commit d671d29ad5
3 changed files with 152 additions and 2 deletions

View File

@ -0,0 +1,13 @@
package sysctl_test
import (
"testing"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
func TestSysctl(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Sysctl Suite")
}