diff --git a/config/data_funcs.go b/config/data_funcs.go index bc92ba2a..37328a29 100644 --- a/config/data_funcs.go +++ b/config/data_funcs.go @@ -123,7 +123,7 @@ func getOrSetVal(args string, data map[interface{}]interface{}, value interface{ func DummyMarshall(value string) interface{} { if strings.HasPrefix(value, "[") && strings.HasSuffix(value, "]") { - result := []string{} + result := []interface{}{} for _, i := range strings.Split(value[1:len(value)-1], ",") { result = append(result, strings.TrimSpace(i)) } diff --git a/tests/integration/rostest/test_09_network.py b/tests/integration/rostest/test_09_network.py index 74e1b0b0..8ab98857 100644 --- a/tests/integration/rostest/test_09_network.py +++ b/tests/integration/rostest/test_09_network.py @@ -34,3 +34,18 @@ ip link show dev eth7 | grep 'master bond0' SCRIPT sudo bash test-merge '''.strip()) + + +def test_network_dns_ros_set(qemu): + SSH(qemu).check_call('bash', '-c', ''' +set -x -e + +sudo ros config set rancher.network.dns.search '[a,b]' +if [ "$(sudo ros config get rancher.network.dns.search)" == "- a + - b + + " ]; then + sudo ros config get rancher.network.dns.search + exit 1 + fi + '''.strip())