Remove WW_INTERNAL
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -16,12 +16,6 @@ warewulf.conf is defined using YAML document markup syntax.
|
|||||||
.LP
|
.LP
|
||||||
The configuration parameters available include:
|
The configuration parameters available include:
|
||||||
|
|
||||||
.TP
|
|
||||||
\fBWW_INTERNAL\fP
|
|
||||||
Specifies the version of the configuration file format. The current
|
|
||||||
version is 43.
|
|
||||||
.IP
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fBipaddr\fP
|
\fBipaddr\fP
|
||||||
This is the control node's networking interface connecting to the
|
This is the control node's networking interface connecting to the
|
||||||
@@ -279,7 +273,6 @@ A sample configuration file for a typical deployment, with all
|
|||||||
dependent services enabled.
|
dependent services enabled.
|
||||||
|
|
||||||
.EX
|
.EX
|
||||||
WW_INTERNAL: 45
|
|
||||||
ipaddr: 10.0.0.1
|
ipaddr: 10.0.0.1
|
||||||
network: 10.0.0.0
|
network: 10.0.0.0
|
||||||
netmask: 255.255.0.0
|
netmask: 255.255.0.0
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 46
|
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
comment: This profile is automatically included for each node
|
comment: This profile is automatically included for each node
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 45
|
|
||||||
ipaddr: 10.0.0.1
|
ipaddr: 10.0.0.1
|
||||||
netmask: 255.255.252.0
|
netmask: 255.255.252.0
|
||||||
warewulf:
|
warewulf:
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ func Test_Clean(t *testing.T) {
|
|||||||
wwlog.SetLogLevel(wwlog.DEBUG)
|
wwlog.SetLogLevel(wwlog.DEBUG)
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
||||||
`WW_INTERNAL: 45
|
`nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
node1: {}
|
node1: {}
|
||||||
`)
|
`)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ CONTAINER NAME NODES KERNEL VERSION CREATION TIME MODIFICATION TIME
|
|||||||
-------------- ----- -------------- ------------- ----------------- ----
|
-------------- ----- -------------- ------------- ----------------- ----
|
||||||
test 1 kernel 01 Jan 70 00:00 UTC 01 Jan 70 00:00 UTC 0 B
|
test 1 kernel 01 Jan 70 00:00 UTC 01 Jan 70 00:00 UTC 0 B
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ func Test_Add(t *testing.T) {
|
|||||||
args: []string{"n01"},
|
args: []string{"n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -34,8 +33,7 @@ nodes:
|
|||||||
args: []string{"--profile=foo", "n01"},
|
args: []string{"--profile=foo", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -45,8 +43,7 @@ nodes:
|
|||||||
args: []string{"--discoverable=true", "n01"},
|
args: []string{"--discoverable=true", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
discoverable: "true"
|
discoverable: "true"
|
||||||
@@ -57,8 +54,7 @@ nodes:
|
|||||||
args: []string{"--discoverable", "n01"},
|
args: []string{"--discoverable", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
discoverable: "true"
|
discoverable: "true"
|
||||||
@@ -70,16 +66,14 @@ nodes:
|
|||||||
wantErr: true,
|
wantErr: true,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
chkout: false,
|
chkout: false,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes: {}
|
nodes: {}
|
||||||
`},
|
`},
|
||||||
{name: "single node add, discoverable false",
|
{name: "single node add, discoverable false",
|
||||||
args: []string{"--discoverable=false", "n01"},
|
args: []string{"--discoverable=false", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
discoverable: "false"
|
discoverable: "false"
|
||||||
@@ -90,8 +84,7 @@ nodes:
|
|||||||
args: []string{"--kernelargs=foo", "n01"},
|
args: []string{"--kernelargs=foo", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
kernel:
|
kernel:
|
||||||
@@ -103,8 +96,7 @@ nodes:
|
|||||||
args: []string{"n01", "n02"},
|
args: []string{"n01", "n02"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -117,8 +109,7 @@ nodes:
|
|||||||
args: []string{"--ipaddr6=fdaa::1", "n01"},
|
args: []string{"--ipaddr6=fdaa::1", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -131,8 +122,7 @@ nodes:
|
|||||||
args: []string{"--ipaddr=10.0.0.1", "n01"},
|
args: []string{"--ipaddr=10.0.0.1", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -146,16 +136,14 @@ nodes:
|
|||||||
wantErr: true,
|
wantErr: true,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
chkout: false,
|
chkout: false,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes: {}
|
nodes: {}
|
||||||
`},
|
`},
|
||||||
{name: "three nodes with ipaddr",
|
{name: "three nodes with ipaddr",
|
||||||
args: []string{"--ipaddr=10.10.0.1", "n[01-02,03]"},
|
args: []string{"--ipaddr=10.10.0.1", "n[01-02,03]"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -180,8 +168,7 @@ nodes:
|
|||||||
args: []string{"--ipaddr=10.10.0.1", "--netname=foo", "n[01-03]"},
|
args: []string{"--ipaddr=10.10.0.1", "--netname=foo", "n[01-03]"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -206,8 +193,7 @@ nodes:
|
|||||||
args: []string{"--ipaddr=10.10.0.1", "--netname=foo", "--ipmiaddr=10.20.0.1", "n[01-03]"},
|
args: []string{"--ipaddr=10.10.0.1", "--netname=foo", "--ipmiaddr=10.20.0.1", "n[01-03]"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
ipmi:
|
ipmi:
|
||||||
@@ -238,8 +224,7 @@ nodes:
|
|||||||
args: []string{"--fsname=/dev/vda1", "--fspath=/var", "n01"},
|
args: []string{"--fsname=/dev/vda1", "--fspath=/var", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -252,16 +237,14 @@ nodes:
|
|||||||
args: []string{"--fsname=dev/vda1", "--fspath=/var", "n01"},
|
args: []string{"--fsname=dev/vda1", "--fspath=/var", "n01"},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes: {}
|
nodes: {}
|
||||||
`},
|
`},
|
||||||
{name: "one node with filesystem and partition ",
|
{name: "one node with filesystem and partition ",
|
||||||
args: []string{"--fsname=var", "--fspath=/var", "--partname=var", "--diskname=/dev/vda", "--partnumber=1", "n01"},
|
args: []string{"--fsname=var", "--fspath=/var", "--partname=var", "--diskname=/dev/vda", "--partnumber=1", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -279,8 +262,7 @@ nodes:
|
|||||||
args: []string{"--fsname=var", "--fspath=/var", "--fsformat=btrfs", "--partname=var", "--diskname=/dev/vda", "--partnumber=1", "n01"},
|
args: []string{"--fsname=var", "--fspath=/var", "--fsformat=btrfs", "--partname=var", "--diskname=/dev/vda", "--partnumber=1", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -299,8 +281,7 @@ nodes:
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
env.WriteFile(t, "etc/warewulf/nodes.conf", ``)
|
||||||
`WW_INTERNAL: 45`)
|
|
||||||
var err error
|
var err error
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
baseCmd := GetCommand()
|
baseCmd := GetCommand()
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ NODE NAME PROFILES NETWORK
|
|||||||
--------- -------- -------
|
--------- -------- -------
|
||||||
n01 [default] --
|
n01 [default] --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
@@ -52,8 +51,7 @@ NODE NAME PROFILES NETWORK
|
|||||||
n01 [default] --
|
n01 [default] --
|
||||||
n02 [default] --
|
n02 [default] --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
@@ -74,8 +72,7 @@ NODE NAME PROFILES NETWORK
|
|||||||
n01 [default] --
|
n01 [default] --
|
||||||
n02 [default] --
|
n02 [default] --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
@@ -96,8 +93,7 @@ NODE NAME PROFILES NETWORK
|
|||||||
n01 [default] --
|
n01 [default] --
|
||||||
n03 [default] --
|
n03 [default] --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
@@ -126,8 +122,7 @@ NODE NAME PROFILES NETWORK
|
|||||||
--------- -------- -------
|
--------- -------- -------
|
||||||
n01 [default] --
|
n01 [default] --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
@@ -147,8 +142,7 @@ NODE NAME PROFILES NETWORK
|
|||||||
--------- -------- -------
|
--------- -------- -------
|
||||||
n01 [default] default
|
n01 [default] default
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
network devices:
|
network devices:
|
||||||
default:
|
default:
|
||||||
@@ -168,8 +162,7 @@ NODE FIELD PROFILE VALUE
|
|||||||
n01 Comment default profilecomment
|
n01 Comment default profilecomment
|
||||||
n01 Profiles -- default
|
n01 Profiles -- default
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: profilecomment
|
comment: profilecomment
|
||||||
nodes:
|
nodes:
|
||||||
@@ -187,8 +180,7 @@ NODE FIELD PROFILE VALUE
|
|||||||
n01 Comment SUPERSEDED nodecomment
|
n01 Comment SUPERSEDED nodecomment
|
||||||
n01 Profiles -- default
|
n01 Profiles -- default
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: profilecomment
|
comment: profilecomment
|
||||||
nodes:
|
nodes:
|
||||||
@@ -206,8 +198,7 @@ NODE IPMI IPADDR IPMI PORT IPMI USERNAME IPMI INTERFACE
|
|||||||
---- ----------- --------- ------------- --------------
|
---- ----------- --------- ------------- --------------
|
||||||
n01 <nil> -- admin --
|
n01 <nil> -- admin --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
username: admin
|
username: admin
|
||||||
@@ -225,8 +216,7 @@ NODE IPMI IPADDR IPMI PORT IPMI USERNAME IPMI INTERFACE
|
|||||||
---- ----------- --------- ------------- --------------
|
---- ----------- --------- ------------- --------------
|
||||||
n01 <nil> -- user --
|
n01 <nil> -- user --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
username: admin
|
username: admin
|
||||||
@@ -246,8 +236,7 @@ NODE NAME PROFILES NETWORK
|
|||||||
--------- -------- -------
|
--------- -------- -------
|
||||||
n01 [p1 p2] --
|
n01 [p1 p2] --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p1: {}
|
p1: {}
|
||||||
p2: {}
|
p2: {}
|
||||||
nodes:
|
nodes:
|
||||||
@@ -265,8 +254,7 @@ NODE FIELD PROFILE VALUE
|
|||||||
---- ----- ------- -----
|
---- ----- ------- -----
|
||||||
n01 Profiles -- p1,p2
|
n01 Profiles -- p1,p2
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p1: {}
|
p1: {}
|
||||||
p2: {}
|
p2: {}
|
||||||
nodes:
|
nodes:
|
||||||
@@ -284,8 +272,7 @@ NODE NAME KERNEL OVERRIDE CONTAINER OVERLAYS (S/R)
|
|||||||
--------- --------------- --------- --------------
|
--------- --------------- --------- --------------
|
||||||
n01 -- -- /rop1,rop2
|
n01 -- -- /rop1,rop2
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p1:
|
p1:
|
||||||
runtime overlay:
|
runtime overlay:
|
||||||
- rop1
|
- rop1
|
||||||
@@ -304,8 +291,7 @@ NODE NAME KERNEL OVERRIDE CONTAINER OVERLAYS (S/R)
|
|||||||
--------- --------------- --------- --------------
|
--------- --------------- --------- --------------
|
||||||
n01 -- -- sop1/nop1,~rop1,rop1,rop2
|
n01 -- -- sop1/nop1,~rop1,rop1,rop2
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p1:
|
p1:
|
||||||
system overlay:
|
system overlay:
|
||||||
- sop1
|
- sop1
|
||||||
@@ -331,8 +317,7 @@ n01 Profiles -- p1
|
|||||||
n01 RuntimeOverlay p1+ nop1,~rop1,rop1,rop2
|
n01 RuntimeOverlay p1+ nop1,~rop1,rop1,rop2
|
||||||
n01 SystemOverlay p1 sop1
|
n01 SystemOverlay p1 sop1
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p1:
|
p1:
|
||||||
system overlay:
|
system overlay:
|
||||||
- sop1
|
- sop1
|
||||||
@@ -357,8 +342,7 @@ NODE FIELD PROFILE VALUE
|
|||||||
n01 Profiles -- p1
|
n01 Profiles -- p1
|
||||||
n01 RuntimeOverlay p1+ nop1,rop1,rop2
|
n01 RuntimeOverlay p1+ nop1,rop1,rop2
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p1:
|
p1:
|
||||||
runtime overlay:
|
runtime overlay:
|
||||||
- rop1
|
- rop1
|
||||||
@@ -379,8 +363,7 @@ NODE FIELD PROFILE VALUE
|
|||||||
---- ----- ------- -----
|
---- ----- ------- -----
|
||||||
n1 NetDevs[default].OnBoot -- true
|
n1 NetDevs[default].OnBoot -- true
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `nodes:
|
||||||
nodes:
|
|
||||||
n1:
|
n1:
|
||||||
network devices:
|
network devices:
|
||||||
default:
|
default:
|
||||||
@@ -394,15 +377,14 @@ nodes:
|
|||||||
NODE FIELD PROFILE VALUE
|
NODE FIELD PROFILE VALUE
|
||||||
---- ----- ------- -----
|
---- ----- ------- -----
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 46
|
inDb: `nodes:
|
||||||
nodes:
|
|
||||||
wwnode1:
|
wwnode1:
|
||||||
network devices:
|
network devices:
|
||||||
default: {}
|
default: {}
|
||||||
`},
|
`},
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_yml := `WW_INTERNAL: 0`
|
conf_yml := ``
|
||||||
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
||||||
assert.NoError(t, warewulfConfErr)
|
assert.NoError(t, warewulfConfErr)
|
||||||
defer os.Remove(tempWarewulfConf.Name())
|
defer os.Remove(tempWarewulfConf.Name())
|
||||||
@@ -459,7 +441,7 @@ func TestListMultipleFormats(t *testing.T) {
|
|||||||
kernel: {}
|
kernel: {}
|
||||||
ipmi: {}
|
ipmi: {}
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
@@ -509,7 +491,7 @@ nodes:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
@@ -593,7 +575,7 @@ nodes:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
@@ -618,7 +600,7 @@ nodes:
|
|||||||
kernel: {}
|
kernel: {}
|
||||||
ipmi: {}
|
ipmi: {}
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func Test_Sensors(t *testing.T) {
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
defer env.RemoveAll(t)
|
defer env.RemoveAll(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 43
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
|
|||||||
@@ -56,16 +56,14 @@ func Test_Single_Node_Change_Profile(t *testing.T) {
|
|||||||
args: []string{"--profile=foo", "n01"},
|
args: []string{"--profile=foo", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
- default`,
|
- default`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -81,15 +79,13 @@ func Test_Node_Unset(t *testing.T) {
|
|||||||
args: []string{"--comment=UNDEF", "n01"},
|
args: []string{"--comment=UNDEF", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
comment: foo
|
comment: foo
|
||||||
profiles:
|
profiles:
|
||||||
- default`,
|
- default`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
@@ -103,13 +99,11 @@ func Test_Set_Ipmi_Write_Explicit(t *testing.T) {
|
|||||||
args: []string{"--ipmiwrite", "true", "n01"},
|
args: []string{"--ipmiwrite", "true", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01: {}
|
n01: {}
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
ipmi:
|
ipmi:
|
||||||
@@ -122,13 +116,11 @@ func Test_Set_Ipmi_Write_Implicit(t *testing.T) {
|
|||||||
args: []string{"--ipmiwrite", "n01"},
|
args: []string{"--ipmiwrite", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01: {}
|
n01: {}
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
ipmi:
|
ipmi:
|
||||||
@@ -142,15 +134,13 @@ func Test_Unset_Ipmi_Write(t *testing.T) {
|
|||||||
args: []string{"--ipmiwrite=UNDEF", "n01"},
|
args: []string{"--ipmiwrite=UNDEF", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
ipmi:
|
ipmi:
|
||||||
write: "true"
|
write: "true"
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01: {}
|
n01: {}
|
||||||
`}
|
`}
|
||||||
@@ -161,15 +151,13 @@ func Test_Unset_Ipmi_Write_False(t *testing.T) {
|
|||||||
args: []string{"--ipmiwrite=UNDEF", "n01"},
|
args: []string{"--ipmiwrite=UNDEF", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
ipmi:
|
ipmi:
|
||||||
write: "false"
|
write: "false"
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01: {}
|
n01: {}
|
||||||
`}
|
`}
|
||||||
@@ -180,8 +168,7 @@ func Test_Ipmi_Hidden_False(t *testing.T) {
|
|||||||
args: []string{"--ipmiwrite=false", "n01"},
|
args: []string{"--ipmiwrite=false", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
write: "true"
|
write: "true"
|
||||||
@@ -190,8 +177,7 @@ nodes:
|
|||||||
profiles:
|
profiles:
|
||||||
- default
|
- default
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
write: "true"
|
write: "true"
|
||||||
@@ -211,16 +197,14 @@ func Test_Multiple_Set_Tests(t *testing.T) {
|
|||||||
args: []string{"--profile=foo", "n01"},
|
args: []string{"--profile=foo", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
- default`,
|
- default`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -232,8 +216,7 @@ nodes:
|
|||||||
args: []string{"--profile=foo", "n0[1-2]"},
|
args: []string{"--profile=foo", "n0[1-2]"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -243,8 +226,7 @@ nodes:
|
|||||||
n02:
|
n02:
|
||||||
profiles:
|
profiles:
|
||||||
- default`,
|
- default`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -259,16 +241,14 @@ nodes:
|
|||||||
args: []string{"--ipmitagadd", "foo=baar", "n01"},
|
args: []string{"--ipmitagadd", "foo=baar", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
- default`,
|
- default`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -283,8 +263,7 @@ nodes:
|
|||||||
args: []string{"--tagdel", "tag1", "n01"},
|
args: []string{"--tagdel", "tag1", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -294,8 +273,7 @@ nodes:
|
|||||||
tags:
|
tags:
|
||||||
tag1: value1
|
tag1: value1
|
||||||
tag2: value2`,
|
tag2: value2`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -309,8 +287,7 @@ nodes:
|
|||||||
args: []string{"--fsname=var", "--fspath=/var", "--fsformat=btrfs", "--partname=var", "--partnumber=1", "--diskname=/dev/vda", "n01"},
|
args: []string{"--fsname=var", "--fspath=/var", "--fsformat=btrfs", "--partname=var", "--partnumber=1", "--diskname=/dev/vda", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -318,8 +295,7 @@ nodes:
|
|||||||
profiles:
|
profiles:
|
||||||
- default
|
- default
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -340,8 +316,7 @@ nodes:
|
|||||||
args: []string{"--fsdel=foo", "n01"},
|
args: []string{"--fsdel=foo", "n01"},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -359,8 +334,7 @@ nodes:
|
|||||||
format: btrfs
|
format: btrfs
|
||||||
path: /var
|
path: /var
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -381,8 +355,7 @@ nodes:
|
|||||||
args: []string{"--fsdel=/dev/disk/by-partlabel/var", "n01"},
|
args: []string{"--fsdel=/dev/disk/by-partlabel/var", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -400,8 +373,7 @@ nodes:
|
|||||||
format: btrfs
|
format: btrfs
|
||||||
path: /var
|
path: /var
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -418,8 +390,7 @@ nodes:
|
|||||||
args: []string{"--partdel=var", "n01"},
|
args: []string{"--partdel=var", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -437,8 +408,7 @@ nodes:
|
|||||||
format: btrfs
|
format: btrfs
|
||||||
path: /var
|
path: /var
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -454,8 +424,7 @@ nodes:
|
|||||||
args: []string{"--diskdel=/dev/vda", "n01"},
|
args: []string{"--diskdel=/dev/vda", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -472,8 +441,7 @@ nodes:
|
|||||||
format: btrfs
|
format: btrfs
|
||||||
path: /var
|
path: /var
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -489,16 +457,14 @@ nodes:
|
|||||||
args: []string{"--mtu", "1234", "--netname=mynet", "n01"},
|
args: []string{"--mtu", "1234", "--netname=mynet", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
- default`,
|
- default`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
nodes:
|
nodes:
|
||||||
@@ -513,8 +479,7 @@ nodes:
|
|||||||
args: []string{"--tagadd", "nodetag1=nodevalue1", "n01"},
|
args: []string{"--tagadd", "nodetag1=nodevalue1", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p1:
|
p1:
|
||||||
comment: testit 1
|
comment: testit 1
|
||||||
tags:
|
tags:
|
||||||
@@ -528,8 +493,7 @@ nodes:
|
|||||||
profiles:
|
profiles:
|
||||||
- p1
|
- p1
|
||||||
- p2`,
|
- p2`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p1:
|
p1:
|
||||||
comment: testit 1
|
comment: testit 1
|
||||||
tags:
|
tags:
|
||||||
@@ -550,20 +514,18 @@ nodes:
|
|||||||
args: []string{"n01", "--comment", "This is a , comment"},
|
args: []string{"n01", "--comment", "This is a , comment"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodes:
|
||||||
nodes:
|
|
||||||
n01:
|
n01:
|
||||||
comment: old comment
|
comment: old comment
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles: {}
|
||||||
nodeprofiles: {}
|
|
||||||
nodes:
|
nodes:
|
||||||
n01:
|
n01:
|
||||||
comment: This is a , comment
|
comment: This is a , comment
|
||||||
`},
|
`},
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_yml := `WW_INTERNAL: 0`
|
conf_yml := ``
|
||||||
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
||||||
assert.NoError(t, warewulfConfErr)
|
assert.NoError(t, warewulfConfErr)
|
||||||
defer os.Remove(tempWarewulfConf.Name())
|
defer os.Remove(tempWarewulfConf.Name())
|
||||||
@@ -588,8 +550,7 @@ func Test_Node_Add(t *testing.T) {
|
|||||||
args: []string{"--tagadd=email=node", "n01"},
|
args: []string{"--tagadd=email=node", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
tags:
|
tags:
|
||||||
@@ -598,8 +559,7 @@ nodes:
|
|||||||
n01:
|
n01:
|
||||||
profiles:
|
profiles:
|
||||||
- default`,
|
- default`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
tags:
|
tags:
|
||||||
@@ -615,8 +575,7 @@ nodes:
|
|||||||
args: []string{"--tagadd=newtag=newval", "n01"},
|
args: []string{"--tagadd=newtag=newval", "n01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 43
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
tags:
|
tags:
|
||||||
@@ -627,8 +586,7 @@ nodes:
|
|||||||
- default
|
- default
|
||||||
tags:
|
tags:
|
||||||
email: node`,
|
email: node`,
|
||||||
outDb: `WW_INTERNAL: 43
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
comment: testit
|
comment: testit
|
||||||
tags:
|
tags:
|
||||||
|
|||||||
@@ -45,14 +45,11 @@ func Test_List(t *testing.T) {
|
|||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
|
|
||||||
inDb := `WW_INTERNAL: 45
|
inDb := `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes: {}
|
nodes: {}
|
||||||
`
|
`
|
||||||
conf_yml := `
|
conf_yml := ``
|
||||||
WW_INTERNAL: 0
|
|
||||||
`
|
|
||||||
|
|
||||||
conf := warewulfconf.New()
|
conf := warewulfconf.New()
|
||||||
err = conf.Parse([]byte(conf_yml))
|
err = conf.Parse([]byte(conf_yml))
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ overlay name {{ .Overlay }}
|
|||||||
|
|
||||||
func Test_Overlay_List(t *testing.T) {
|
func Test_Overlay_List(t *testing.T) {
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
env.WriteFile(t, "etc/warewulf/warewulf.conf", `WW_INTERNAL: 43
|
env.WriteFile(t, "etc/warewulf/warewulf.conf", `ipaddr: 192.168.0.1/24
|
||||||
ipaddr: 192.168.0.1/24
|
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.0.0
|
network: 192.168.0.0
|
||||||
warewulf:
|
warewulf:
|
||||||
@@ -53,8 +52,7 @@ nfs:
|
|||||||
mount: false`)
|
mount: false`)
|
||||||
|
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
||||||
`WW_INTERNAL: 45
|
`nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
tags:
|
tags:
|
||||||
email: admin@localhost
|
email: admin@localhost
|
||||||
@@ -141,8 +139,7 @@ func TestShowServerTemplate(t *testing.T) {
|
|||||||
|
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
||||||
`WW_INTERNAL: 45
|
`nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
tags:
|
tags:
|
||||||
email: admin@localhost
|
email: admin@localhost
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func Test_PowerCycle(t *testing.T) {
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
defer env.RemoveAll(t)
|
defer env.RemoveAll(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 43
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func Test_Power_Status(t *testing.T) {
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
defer env.RemoveAll(t)
|
defer env.RemoveAll(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 43
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func Test_Power_Status(t *testing.T) {
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
defer env.RemoveAll(t)
|
defer env.RemoveAll(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 43
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func Test_Power_Status(t *testing.T) {
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
defer env.RemoveAll(t)
|
defer env.RemoveAll(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 43
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func Test_Power_Status(t *testing.T) {
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
defer env.RemoveAll(t)
|
defer env.RemoveAll(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 43
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func Test_Power_Status(t *testing.T) {
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
defer env.RemoveAll(t)
|
defer env.RemoveAll(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 43
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
ipmi:
|
ipmi:
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ func Test_Add(t *testing.T) {
|
|||||||
args: []string{"p01"},
|
args: []string{"p01"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p01: {}
|
p01: {}
|
||||||
nodes: {}
|
nodes: {}
|
||||||
`,
|
`,
|
||||||
@@ -34,8 +33,7 @@ nodes: {}
|
|||||||
args: []string{"--netname", "primary", "--netdev", "eno3", "p02"},
|
args: []string{"--netname", "primary", "--netdev", "eno3", "p02"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
p02:
|
p02:
|
||||||
network devices:
|
network devices:
|
||||||
primary:
|
primary:
|
||||||
@@ -48,8 +46,7 @@ nodes: {}
|
|||||||
warewulfd.SetNoDaemon()
|
warewulfd.SetNoDaemon()
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
env.WriteFile(t, "etc/warewulf/nodes.conf", ``)
|
||||||
`WW_INTERNAL: 45`)
|
|
||||||
var err error
|
var err error
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
baseCmd := GetCommand()
|
baseCmd := GetCommand()
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ PROFILE NAME COMMENT/DESCRIPTION
|
|||||||
------------ -------------------
|
------------ -------------------
|
||||||
default --
|
default --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
@@ -47,7 +47,7 @@ PROFILE NAME COMMENT/DESCRIPTION
|
|||||||
default --
|
default --
|
||||||
test --
|
test --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
test: {}
|
test: {}
|
||||||
@@ -65,7 +65,7 @@ PROFILE NAME COMMENT/DESCRIPTION
|
|||||||
------------ -------------------
|
------------ -------------------
|
||||||
test --
|
test --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
test: {}
|
test: {}
|
||||||
@@ -84,7 +84,7 @@ PROFILE NAME COMMENT/DESCRIPTION
|
|||||||
default --
|
default --
|
||||||
test --
|
test --
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 45
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
test: {}
|
test: {}
|
||||||
@@ -96,7 +96,7 @@ nodes:
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_yml := `WW_INTERNAL: 0`
|
conf_yml := ``
|
||||||
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
||||||
assert.NoError(t, warewulfConfErr)
|
assert.NoError(t, warewulfConfErr)
|
||||||
defer os.Remove(tempWarewulfConf.Name())
|
defer os.Remove(tempWarewulfConf.Name())
|
||||||
@@ -158,7 +158,7 @@ func TestListMultipleFormats(t *testing.T) {
|
|||||||
name: "single profile list yaml output",
|
name: "single profile list yaml output",
|
||||||
args: []string{"-y"},
|
args: []string{"-y"},
|
||||||
output: `default: {}`,
|
output: `default: {}`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
@@ -191,7 +191,7 @@ nodes:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
@@ -207,7 +207,7 @@ nodes:
|
|||||||
default: {}
|
default: {}
|
||||||
test: {}
|
test: {}
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
test: {}
|
test: {}
|
||||||
@@ -258,7 +258,7 @@ nodes:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
inDb: `WW_INTERNAL: 43
|
inDb: `
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default: {}
|
default: {}
|
||||||
test: {}
|
test: {}
|
||||||
@@ -270,7 +270,7 @@ nodes:
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_yml := `WW_INTERNAL: 0`
|
conf_yml := ``
|
||||||
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
||||||
assert.NoError(t, warewulfConfErr)
|
assert.NoError(t, warewulfConfErr)
|
||||||
defer os.Remove(tempWarewulfConf.Name())
|
defer os.Remove(tempWarewulfConf.Name())
|
||||||
|
|||||||
@@ -54,13 +54,11 @@ func Test_Set_Netdev(t *testing.T) {
|
|||||||
args: []string{"--netname=default", "--netdev=eth0", "default"},
|
args: []string{"--netname=default", "--netdev=eth0", "default"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes: {}
|
nodes: {}
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
network devices:
|
network devices:
|
||||||
default:
|
default:
|
||||||
@@ -74,13 +72,11 @@ func Test_Set_Netdev_and_Mask(t *testing.T) {
|
|||||||
args: []string{"--netname=default", "--netdev=eth0", "-M=255.255.255.0", "default"},
|
args: []string{"--netname=default", "--netdev=eth0", "-M=255.255.255.0", "default"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes: {}
|
nodes: {}
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
network devices:
|
network devices:
|
||||||
default:
|
default:
|
||||||
@@ -96,16 +92,14 @@ func Test_Set_Mask_Existing_NetDev(t *testing.T) {
|
|||||||
args: []string{"--netname=default", "-M=255.255.255.0", "default"},
|
args: []string{"--netname=default", "-M=255.255.255.0", "default"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
stdout: "",
|
stdout: "",
|
||||||
inDB: `WW_INTERNAL: 45
|
inDB: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
network devices:
|
network devices:
|
||||||
default:
|
default:
|
||||||
device: eth0
|
device: eth0
|
||||||
nodes: {}
|
nodes: {}
|
||||||
`,
|
`,
|
||||||
outDb: `WW_INTERNAL: 45
|
outDb: `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
network devices:
|
network devices:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ func rootPersistentPreRunE(cmd *cobra.Command, args []string) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("version: %s relase: %s WW_INTERNAL: %s", warewulfconf.Version, warewulfconf.Release, warewulfconf.Confversion)
|
wwlog.Error("version: %s relase: %s", warewulfconf.Version, warewulfconf.Release)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = conf.SetDynamicDefaults()
|
err = conf.SetDynamicDefaults()
|
||||||
|
|||||||
@@ -24,9 +24,6 @@ type BuildConfig struct {
|
|||||||
const Version = "@VERSION@"
|
const Version = "@VERSION@"
|
||||||
const Release = "@RELEASE@"
|
const Release = "@RELEASE@"
|
||||||
|
|
||||||
// must be set .in file so that its available for tests
|
|
||||||
const Confversion = "45"
|
|
||||||
|
|
||||||
type TFTPConf struct {
|
type TFTPConf struct {
|
||||||
Enabled bool `yaml:"enabled" default:"true"`
|
Enabled bool `yaml:"enabled" default:"true"`
|
||||||
TftpRoot string `yaml:"tftproot" default:"@TFTPDIR@"`
|
TftpRoot string `yaml:"tftproot" default:"@TFTPDIR@"`
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ var cachedConf RootConf
|
|||||||
// some information about the Warewulf server locally, and has
|
// some information about the Warewulf server locally, and has
|
||||||
// [WarewulfConf], [DHCPConf], [TFTPConf], and [NFSConf] sub-sections.
|
// [WarewulfConf], [DHCPConf], [TFTPConf], and [NFSConf] sub-sections.
|
||||||
type RootConf struct {
|
type RootConf struct {
|
||||||
WWInternal int `yaml:"WW_INTERNAL"`
|
|
||||||
Comment string `yaml:"comment,omitempty"`
|
Comment string `yaml:"comment,omitempty"`
|
||||||
Ipaddr string `yaml:"ipaddr"`
|
Ipaddr string `yaml:"ipaddr"`
|
||||||
Ipaddr6 string `yaml:"ipaddr6,omitempty"`
|
Ipaddr6 string `yaml:"ipaddr6,omitempty"`
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ func TestDefaultRootConf(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestInitializedFromFile(t *testing.T) {
|
func TestInitializedFromFile(t *testing.T) {
|
||||||
example_warewulf_conf := "WW_INTERNAL: 45"
|
example_warewulf_conf := ""
|
||||||
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
||||||
assert.NoError(t, warewulfConfErr)
|
assert.NoError(t, warewulfConfErr)
|
||||||
defer os.Remove(tempWarewulfConf.Name())
|
defer os.Remove(tempWarewulfConf.Name())
|
||||||
@@ -70,7 +70,7 @@ func TestInitializedFromFile(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestExampleRootConf(t *testing.T) {
|
func TestExampleRootConf(t *testing.T) {
|
||||||
example_warewulf_conf := `WW_INTERNAL: 45
|
example_warewulf_conf := `
|
||||||
ipaddr: 192.168.200.1
|
ipaddr: 192.168.200.1
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.200.0
|
network: 192.168.200.0
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ const undef string = "UNDEF"
|
|||||||
Structure of which goes to disk
|
Structure of which goes to disk
|
||||||
*/
|
*/
|
||||||
type NodeYaml struct {
|
type NodeYaml struct {
|
||||||
WWInternal int `yaml:"WW_INTERNAL,omitempty" json:"WW_INTERNAL,omitempty"`
|
|
||||||
nodeProfiles map[string]*Profile
|
nodeProfiles map[string]*Profile
|
||||||
nodes map[string]*Node
|
nodes map[string]*Node
|
||||||
}
|
}
|
||||||
@@ -134,7 +133,6 @@ interface so that nodes and profiles which aren't exported will
|
|||||||
be marshaled
|
be marshaled
|
||||||
*/
|
*/
|
||||||
type ExportedYml struct {
|
type ExportedYml struct {
|
||||||
WWInternal int `yaml:"WW_INTERNAL"`
|
|
||||||
NodeProfiles map[string]*Profile `yaml:"nodeprofiles"`
|
NodeProfiles map[string]*Profile `yaml:"nodeprofiles"`
|
||||||
Nodes map[string]*Node `yaml:"nodes"`
|
Nodes map[string]*Node `yaml:"nodes"`
|
||||||
}
|
}
|
||||||
@@ -145,7 +143,6 @@ Marshall Exported stuff, not NodeYaml directly
|
|||||||
func (yml *NodeYaml) MarshalYAML() (interface{}, error) {
|
func (yml *NodeYaml) MarshalYAML() (interface{}, error) {
|
||||||
wwlog.Debug("marshall yml")
|
wwlog.Debug("marshall yml")
|
||||||
var exp ExportedYml
|
var exp ExportedYml
|
||||||
exp.WWInternal = yml.WWInternal
|
|
||||||
exp.Nodes = yml.nodes
|
exp.Nodes = yml.nodes
|
||||||
exp.NodeProfiles = yml.nodeProfiles
|
exp.NodeProfiles = yml.nodeProfiles
|
||||||
node := yaml.Node{}
|
node := yaml.Node{}
|
||||||
@@ -168,7 +165,6 @@ func (yml *NodeYaml) UnmarshalYAML(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
yml.WWInternal = exp.WWInternal
|
|
||||||
yml.nodes = exp.Nodes
|
yml.nodes = exp.Nodes
|
||||||
yml.nodeProfiles = exp.NodeProfiles
|
yml.nodeProfiles = exp.NodeProfiles
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import (
|
|||||||
|
|
||||||
func TestHash(t *testing.T) {
|
func TestHash(t *testing.T) {
|
||||||
nodeConfYml1 := `
|
nodeConfYml1 := `
|
||||||
WW_INTERNAL: 45
|
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
comment: This profile is automatically included for each node
|
comment: This profile is automatically included for each node
|
||||||
@@ -33,7 +32,6 @@ nodes:
|
|||||||
ipaddr: 10.0.10.2
|
ipaddr: 10.0.10.2
|
||||||
`
|
`
|
||||||
nodeConfYml2 := `
|
nodeConfYml2 := `
|
||||||
WW_INTERNAL: 45
|
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
comment: This profile is automatically included for each node
|
comment: This profile is automatically included for each node
|
||||||
@@ -56,7 +54,6 @@ nodes:
|
|||||||
ipaddr: 10.0.10.1
|
ipaddr: 10.0.10.1
|
||||||
`
|
`
|
||||||
nodeConfYml3 := `
|
nodeConfYml3 := `
|
||||||
WW_INTERNAL: 45
|
|
||||||
nodeprofiles:
|
nodeprofiles:
|
||||||
default:
|
default:
|
||||||
comment: This profile is automatically included for each node
|
comment: This profile is automatically included for each node
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Test_createIgnitionJson(t *testing.T) {
|
func Test_createIgnitionJson(t *testing.T) {
|
||||||
node_config := `WW_INTERNAL: 45
|
node_config := `nodes:
|
||||||
nodes:
|
|
||||||
n1:
|
n1:
|
||||||
disks:
|
disks:
|
||||||
/dev/vda:
|
/dev/vda:
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ import (
|
|||||||
"github.com/warewulf/warewulf/internal/pkg/node"
|
"github.com/warewulf/warewulf/internal/pkg/node"
|
||||||
)
|
)
|
||||||
|
|
||||||
const initWarewulfConf = `WW_INTERNAL: 0`
|
const initWarewulfConf = ``
|
||||||
const initNodesConf = `WW_INTERNAL: 45
|
const initNodesConf = `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
node1: {}
|
node1: {}
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ func Test_Basic(t *testing.T) {
|
|||||||
|
|
||||||
func Test_two_nodes(t *testing.T) {
|
func Test_two_nodes(t *testing.T) {
|
||||||
env := New(t)
|
env := New(t)
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 45
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default: {}
|
default: {}
|
||||||
nodes:
|
nodes:
|
||||||
node1: {}
|
node1: {}
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ var provisionSendTests = []struct {
|
|||||||
func Test_ProvisionSend(t *testing.T) {
|
func Test_ProvisionSend(t *testing.T) {
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
|
|
||||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 45
|
env.WriteFile(t, "etc/warewulf/nodes.conf", `nodeprofiles:
|
||||||
nodeprofiles:
|
|
||||||
default:
|
default:
|
||||||
container name: suse
|
container name: suse
|
||||||
nodes:
|
nodes:
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 45
|
|
||||||
nodes:
|
nodes:
|
||||||
node1:
|
node1:
|
||||||
network devices:
|
network devices:
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 45
|
|
||||||
nodes:
|
nodes:
|
||||||
node1:
|
node1:
|
||||||
network devices:
|
network devices:
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 43
|
|
||||||
ipaddr: 192.168.0.1/24
|
ipaddr: 192.168.0.1/24
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.0.0
|
network: 192.168.0.0
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 43
|
|
||||||
ipaddr: 192.168.0.1/24
|
ipaddr: 192.168.0.1/24
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.0.0
|
network: 192.168.0.0
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 43
|
|
||||||
ipaddr: 192.168.0.1/24
|
ipaddr: 192.168.0.1/24
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.0.0
|
network: 192.168.0.0
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 43
|
|
||||||
ipaddr: 192.168.0.1/24
|
ipaddr: 192.168.0.1/24
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.0.0
|
network: 192.168.0.0
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
WW_INTERNAL: 43
|
|
||||||
ipaddr: 192.168.0.1/24
|
ipaddr: 192.168.0.1/24
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.0.0
|
network: 192.168.0.0
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ func Test_wwinitOverlay(t *testing.T) {
|
|||||||
const wwinit_warewulf_conf string = `backupFile: true
|
const wwinit_warewulf_conf string = `backupFile: true
|
||||||
writeFile: true
|
writeFile: true
|
||||||
Filename: etc/warewulf/warewulf.conf
|
Filename: etc/warewulf/warewulf.conf
|
||||||
WW_INTERNAL: 43
|
|
||||||
ipaddr: 192.168.0.1/24
|
ipaddr: 192.168.0.1/24
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.0.0
|
network: 192.168.0.0
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ Warewulf (4.5.2):
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
WW_INTERNAL: 45
|
|
||||||
ipaddr: 10.0.0.1
|
ipaddr: 10.0.0.1
|
||||||
netmask: 255.255.252.0
|
netmask: 255.255.252.0
|
||||||
network: 10.0.0.0
|
network: 10.0.0.0
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ Vagrantfile
|
|||||||
|
|
||||||
head.vm.provision "shell", inline: <<-SHELL
|
head.vm.provision "shell", inline: <<-SHELL
|
||||||
cat << 'CONF' | sudo tee /etc/warewulf/warewulf.conf
|
cat << 'CONF' | sudo tee /etc/warewulf/warewulf.conf
|
||||||
WW_INTERNAL: 45
|
|
||||||
ipaddr: 192.168.200.254
|
ipaddr: 192.168.200.254
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.200.0
|
network: 192.168.200.0
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ address of your cluster's private network interface:
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
WW_INTERNAL: 45
|
|
||||||
ipaddr: 192.168.200.1
|
ipaddr: 192.168.200.1
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.200.0
|
network: 192.168.200.0
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ address of your cluster's private network interface.
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
WW_INTERNAL: 45
|
|
||||||
ipaddr: 10.0.0.1
|
ipaddr: 10.0.0.1
|
||||||
netmask: 255.255.252.0
|
netmask: 255.255.252.0
|
||||||
network: 10.0.0.0
|
network: 10.0.0.0
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ address of your cluster's private network interface:
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
WW_INTERNAL: 45
|
|
||||||
ipaddr: 192.168.200.1
|
ipaddr: 192.168.200.1
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
network: 192.168.200.0
|
network: 192.168.200.0
|
||||||
|
|||||||
Reference in New Issue
Block a user