Revert "Move configuration code out of wwctl"
This commit is contained in:
committed by
GitHub
parent
5a7f99af18
commit
67ee3bf5f8
28
internal/app/wwctl/configure/dhcp/dhcp_main_test.go
Normal file
28
internal/app/wwctl/configure/dhcp/dhcp_main_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package dhcp
|
||||
|
||||
import (
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/buildconfig"
|
||||
)
|
||||
|
||||
func TestDhcpTemplateFile(t *testing.T) {
|
||||
tests := []struct{
|
||||
parameter string
|
||||
expected string
|
||||
}{
|
||||
{"", path.Join(buildconfig.SYSCONFDIR(), "warewulf/dhcp/default-dhcpd.conf")},
|
||||
{"default", path.Join(buildconfig.SYSCONFDIR(), "warewulf/dhcp/default-dhcpd.conf")},
|
||||
{"static", path.Join(buildconfig.SYSCONFDIR(), "warewulf/dhcp/static-dhcpd.conf")},
|
||||
{"/test/absolute/path.conf", "/test/absolute/path.conf"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
actual := dhcpTemplateFile(tt.parameter)
|
||||
if actual != tt.expected {
|
||||
t.Errorf("dhcpTemplateFile(%v) expected: %v, actual: %v",
|
||||
tt.parameter, tt.expected, actual)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user