1
0
mirror of https://github.com/rancher/os.git synced 2025-08-15 05:26:21 +00:00
os/cmd/control/config_test.go
Olli Janatuinen 6e80223672 Fixed issues found from v1.9.0-beta2
- Replaced default console with Debian console
- Included Project Burmilla to ros command info
- Fixed docker-machine compability
- Bump up kernel to 4.14.207
- Include /etc/lsb-release file to Debian console
- Updated ifconfig parsing command to match Debian console syntax
- Corrected Burmilla URLs
- Use fixed version of open-vm-tools
- Create /var/log/wtmp file on first boot so "last" command will works
- Use /etc/issue file as motd
- Support to create ISO file without firmware files
2021-02-18 20:08:53 +02:00

57 lines
1003 B
Go

package control
import (
"bytes"
"os"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestGenTpl(t *testing.T) {
assert := require.New(t)
tpl := `
services:
{{if eq "amd64" .ARCH -}}
acpid:
image: burmilla/os-acpid:0.x.x
labels:
io.rancher.os.scope: system
net: host
uts: host
privileged: true
volumes_from:
- command-volumes
- system-volumes
{{end -}}
all-volumes:`
for _, tc := range []struct {
arch string
expected string
}{
{"amd64", `
services:
acpid:
image: burmilla/os-acpid:0.x.x
labels:
io.rancher.os.scope: system
net: host
uts: host
privileged: true
volumes_from:
- command-volumes
- system-volumes
all-volumes:`},
{"arm", `
services:
all-volumes:`},
} {
out := &bytes.Buffer{}
os.Setenv("ARCH", tc.arch)
genTpl(strings.NewReader(tpl), out)
assert.Equal(tc.expected, out.String(), tc.arch)
}
}