package guestnet

import (
	"strings"
	"testing"
)

func TestConfigFileIncludesStaticGuestNetworking(t *testing.T) {
	t.Parallel()

	got := string(ConfigFile("172.16.0.2", "172.16.0.1", "1.1.1.1"))
	for _, want := range []string{
		"GUEST_IP='172.16.0.2'",
		"GATEWAY_IP='172.16.0.1'",
		"NETMASK='255.255.255.0'",
		"INTERFACE='eth0'",
		"DNS1='1.1.1.1'",
		"DNS2=''",
	} {
		if !strings.Contains(got, want) {
			t.Fatalf("ConfigFile() missing %q\nconfig:\n%s", want, got)
		}
	}
}
