Remove WW_INTERNAL
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -23,8 +23,7 @@ func Test_Add(t *testing.T) {
|
||||
args: []string{"n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -34,8 +33,7 @@ nodes:
|
||||
args: []string{"--profile=foo", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -45,8 +43,7 @@ nodes:
|
||||
args: []string{"--discoverable=true", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
discoverable: "true"
|
||||
@@ -57,8 +54,7 @@ nodes:
|
||||
args: []string{"--discoverable", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
discoverable: "true"
|
||||
@@ -70,16 +66,14 @@ nodes:
|
||||
wantErr: true,
|
||||
stdout: "",
|
||||
chkout: false,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes: {}
|
||||
`},
|
||||
{name: "single node add, discoverable false",
|
||||
args: []string{"--discoverable=false", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
discoverable: "false"
|
||||
@@ -90,8 +84,7 @@ nodes:
|
||||
args: []string{"--kernelargs=foo", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
kernel:
|
||||
@@ -103,8 +96,7 @@ nodes:
|
||||
args: []string{"n01", "n02"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -117,8 +109,7 @@ nodes:
|
||||
args: []string{"--ipaddr6=fdaa::1", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -131,8 +122,7 @@ nodes:
|
||||
args: []string{"--ipaddr=10.0.0.1", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -146,16 +136,14 @@ nodes:
|
||||
wantErr: true,
|
||||
stdout: "",
|
||||
chkout: false,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes: {}
|
||||
`},
|
||||
{name: "three nodes with ipaddr",
|
||||
args: []string{"--ipaddr=10.10.0.1", "n[01-02,03]"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -180,8 +168,7 @@ nodes:
|
||||
args: []string{"--ipaddr=10.10.0.1", "--netname=foo", "n[01-03]"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -206,8 +193,7 @@ nodes:
|
||||
args: []string{"--ipaddr=10.10.0.1", "--netname=foo", "--ipmiaddr=10.20.0.1", "n[01-03]"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
ipmi:
|
||||
@@ -238,8 +224,7 @@ nodes:
|
||||
args: []string{"--fsname=/dev/vda1", "--fspath=/var", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -252,16 +237,14 @@ nodes:
|
||||
args: []string{"--fsname=dev/vda1", "--fspath=/var", "n01"},
|
||||
wantErr: true,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes: {}
|
||||
`},
|
||||
{name: "one node with filesystem and partition ",
|
||||
args: []string{"--fsname=var", "--fspath=/var", "--partname=var", "--diskname=/dev/vda", "--partnumber=1", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -279,8 +262,7 @@ nodes:
|
||||
args: []string{"--fsname=var", "--fspath=/var", "--fsformat=btrfs", "--partname=var", "--diskname=/dev/vda", "--partnumber=1", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -299,8 +281,7 @@ nodes:
|
||||
warewulfd.SetNoDaemon()
|
||||
for _, tt := range tests {
|
||||
env := testenv.New(t)
|
||||
env.WriteFile(t, "etc/warewulf/nodes.conf",
|
||||
`WW_INTERNAL: 45`)
|
||||
env.WriteFile(t, "etc/warewulf/nodes.conf", ``)
|
||||
var err error
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
baseCmd := GetCommand()
|
||||
|
||||
@@ -33,8 +33,7 @@ NODE NAME PROFILES NETWORK
|
||||
--------- -------- -------
|
||||
n01 [default] --
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
n01:
|
||||
@@ -52,8 +51,7 @@ NODE NAME PROFILES NETWORK
|
||||
n01 [default] --
|
||||
n02 [default] --
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
n01:
|
||||
@@ -74,8 +72,7 @@ NODE NAME PROFILES NETWORK
|
||||
n01 [default] --
|
||||
n02 [default] --
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
n01:
|
||||
@@ -96,8 +93,7 @@ NODE NAME PROFILES NETWORK
|
||||
n01 [default] --
|
||||
n03 [default] --
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
n01:
|
||||
@@ -126,8 +122,7 @@ NODE NAME PROFILES NETWORK
|
||||
--------- -------- -------
|
||||
n01 [default] --
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
n01:
|
||||
@@ -147,8 +142,7 @@ NODE NAME PROFILES NETWORK
|
||||
--------- -------- -------
|
||||
n01 [default] default
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default:
|
||||
network devices:
|
||||
default:
|
||||
@@ -168,8 +162,7 @@ NODE FIELD PROFILE VALUE
|
||||
n01 Comment default profilecomment
|
||||
n01 Profiles -- default
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default:
|
||||
comment: profilecomment
|
||||
nodes:
|
||||
@@ -187,8 +180,7 @@ NODE FIELD PROFILE VALUE
|
||||
n01 Comment SUPERSEDED nodecomment
|
||||
n01 Profiles -- default
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default:
|
||||
comment: profilecomment
|
||||
nodes:
|
||||
@@ -206,8 +198,7 @@ NODE IPMI IPADDR IPMI PORT IPMI USERNAME IPMI INTERFACE
|
||||
---- ----------- --------- ------------- --------------
|
||||
n01 <nil> -- admin --
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
username: admin
|
||||
@@ -225,8 +216,7 @@ NODE IPMI IPADDR IPMI PORT IPMI USERNAME IPMI INTERFACE
|
||||
---- ----------- --------- ------------- --------------
|
||||
n01 <nil> -- user --
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
username: admin
|
||||
@@ -246,8 +236,7 @@ NODE NAME PROFILES NETWORK
|
||||
--------- -------- -------
|
||||
n01 [p1 p2] --
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
p1: {}
|
||||
p2: {}
|
||||
nodes:
|
||||
@@ -265,8 +254,7 @@ NODE FIELD PROFILE VALUE
|
||||
---- ----- ------- -----
|
||||
n01 Profiles -- p1,p2
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
p1: {}
|
||||
p2: {}
|
||||
nodes:
|
||||
@@ -284,8 +272,7 @@ NODE NAME KERNEL OVERRIDE CONTAINER OVERLAYS (S/R)
|
||||
--------- --------------- --------- --------------
|
||||
n01 -- -- /rop1,rop2
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
p1:
|
||||
runtime overlay:
|
||||
- rop1
|
||||
@@ -304,8 +291,7 @@ NODE NAME KERNEL OVERRIDE CONTAINER OVERLAYS (S/R)
|
||||
--------- --------------- --------- --------------
|
||||
n01 -- -- sop1/nop1,~rop1,rop1,rop2
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
p1:
|
||||
system overlay:
|
||||
- sop1
|
||||
@@ -331,8 +317,7 @@ n01 Profiles -- p1
|
||||
n01 RuntimeOverlay p1+ nop1,~rop1,rop1,rop2
|
||||
n01 SystemOverlay p1 sop1
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
p1:
|
||||
system overlay:
|
||||
- sop1
|
||||
@@ -357,8 +342,7 @@ NODE FIELD PROFILE VALUE
|
||||
n01 Profiles -- p1
|
||||
n01 RuntimeOverlay p1+ nop1,rop1,rop2
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDb: `nodeprofiles:
|
||||
p1:
|
||||
runtime overlay:
|
||||
- rop1
|
||||
@@ -379,8 +363,7 @@ NODE FIELD PROFILE VALUE
|
||||
---- ----- ------- -----
|
||||
n1 NetDevs[default].OnBoot -- true
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 45
|
||||
nodes:
|
||||
inDb: `nodes:
|
||||
n1:
|
||||
network devices:
|
||||
default:
|
||||
@@ -394,15 +377,14 @@ nodes:
|
||||
NODE FIELD PROFILE VALUE
|
||||
---- ----- ------- -----
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 46
|
||||
nodes:
|
||||
inDb: `nodes:
|
||||
wwnode1:
|
||||
network devices:
|
||||
default: {}
|
||||
`},
|
||||
}
|
||||
|
||||
conf_yml := `WW_INTERNAL: 0`
|
||||
conf_yml := ``
|
||||
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
||||
assert.NoError(t, warewulfConfErr)
|
||||
defer os.Remove(tempWarewulfConf.Name())
|
||||
@@ -459,7 +441,7 @@ func TestListMultipleFormats(t *testing.T) {
|
||||
kernel: {}
|
||||
ipmi: {}
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 43
|
||||
inDb: `
|
||||
nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
@@ -509,7 +491,7 @@ nodes:
|
||||
}
|
||||
]
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 43
|
||||
inDb: `
|
||||
nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
@@ -593,7 +575,7 @@ nodes:
|
||||
}
|
||||
]
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 43
|
||||
inDb: `
|
||||
nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
@@ -618,7 +600,7 @@ nodes:
|
||||
kernel: {}
|
||||
ipmi: {}
|
||||
`,
|
||||
inDb: `WW_INTERNAL: 43
|
||||
inDb: `
|
||||
nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
|
||||
@@ -15,7 +15,7 @@ func Test_Sensors(t *testing.T) {
|
||||
warewulfd.SetNoDaemon()
|
||||
env := testenv.New(t)
|
||||
defer env.RemoveAll(t)
|
||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `WW_INTERNAL: 43
|
||||
env.WriteFile(t, "etc/warewulf/nodes.conf", `
|
||||
nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
|
||||
@@ -56,16 +56,14 @@ func Test_Single_Node_Change_Profile(t *testing.T) {
|
||||
args: []string{"--profile=foo", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
- default`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -81,15 +79,13 @@ func Test_Node_Unset(t *testing.T) {
|
||||
args: []string{"--comment=UNDEF", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
inDB: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
comment: foo
|
||||
profiles:
|
||||
- default`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
@@ -103,13 +99,11 @@ func Test_Set_Ipmi_Write_Explicit(t *testing.T) {
|
||||
args: []string{"--ipmiwrite", "true", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
inDB: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01: {}
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
ipmi:
|
||||
@@ -122,13 +116,11 @@ func Test_Set_Ipmi_Write_Implicit(t *testing.T) {
|
||||
args: []string{"--ipmiwrite", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
inDB: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01: {}
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
ipmi:
|
||||
@@ -142,15 +134,13 @@ func Test_Unset_Ipmi_Write(t *testing.T) {
|
||||
args: []string{"--ipmiwrite=UNDEF", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
inDB: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
ipmi:
|
||||
write: "true"
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01: {}
|
||||
`}
|
||||
@@ -161,15 +151,13 @@ func Test_Unset_Ipmi_Write_False(t *testing.T) {
|
||||
args: []string{"--ipmiwrite=UNDEF", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
inDB: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
ipmi:
|
||||
write: "false"
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01: {}
|
||||
`}
|
||||
@@ -180,8 +168,7 @@ func Test_Ipmi_Hidden_False(t *testing.T) {
|
||||
args: []string{"--ipmiwrite=false", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
write: "true"
|
||||
@@ -190,8 +177,7 @@ nodes:
|
||||
profiles:
|
||||
- default
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
ipmi:
|
||||
write: "true"
|
||||
@@ -211,16 +197,14 @@ func Test_Multiple_Set_Tests(t *testing.T) {
|
||||
args: []string{"--profile=foo", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
- default`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -232,8 +216,7 @@ nodes:
|
||||
args: []string{"--profile=foo", "n0[1-2]"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -243,8 +226,7 @@ nodes:
|
||||
n02:
|
||||
profiles:
|
||||
- default`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -259,16 +241,14 @@ nodes:
|
||||
args: []string{"--ipmitagadd", "foo=baar", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
- default`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -283,8 +263,7 @@ nodes:
|
||||
args: []string{"--tagdel", "tag1", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -294,8 +273,7 @@ nodes:
|
||||
tags:
|
||||
tag1: value1
|
||||
tag2: value2`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -309,8 +287,7 @@ nodes:
|
||||
args: []string{"--fsname=var", "--fspath=/var", "--fsformat=btrfs", "--partname=var", "--partnumber=1", "--diskname=/dev/vda", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -318,8 +295,7 @@ nodes:
|
||||
profiles:
|
||||
- default
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -340,8 +316,7 @@ nodes:
|
||||
args: []string{"--fsdel=foo", "n01"},
|
||||
wantErr: true,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -359,8 +334,7 @@ nodes:
|
||||
format: btrfs
|
||||
path: /var
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -381,8 +355,7 @@ nodes:
|
||||
args: []string{"--fsdel=/dev/disk/by-partlabel/var", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -400,8 +373,7 @@ nodes:
|
||||
format: btrfs
|
||||
path: /var
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -418,8 +390,7 @@ nodes:
|
||||
args: []string{"--partdel=var", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -437,8 +408,7 @@ nodes:
|
||||
format: btrfs
|
||||
path: /var
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -454,8 +424,7 @@ nodes:
|
||||
args: []string{"--diskdel=/dev/vda", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -472,8 +441,7 @@ nodes:
|
||||
format: btrfs
|
||||
path: /var
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -489,16 +457,14 @@ nodes:
|
||||
args: []string{"--mtu", "1234", "--netname=mynet", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
- default`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
@@ -513,8 +479,7 @@ nodes:
|
||||
args: []string{"--tagadd", "nodetag1=nodevalue1", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
p1:
|
||||
comment: testit 1
|
||||
tags:
|
||||
@@ -528,8 +493,7 @@ nodes:
|
||||
profiles:
|
||||
- p1
|
||||
- p2`,
|
||||
outDb: `WW_INTERNAL: 45
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
p1:
|
||||
comment: testit 1
|
||||
tags:
|
||||
@@ -550,20 +514,18 @@ nodes:
|
||||
args: []string{"n01", "--comment", "This is a , comment"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodes:
|
||||
inDB: `nodes:
|
||||
n01:
|
||||
comment: old comment
|
||||
`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles: {}
|
||||
outDb: `nodeprofiles: {}
|
||||
nodes:
|
||||
n01:
|
||||
comment: This is a , comment
|
||||
`},
|
||||
}
|
||||
|
||||
conf_yml := `WW_INTERNAL: 0`
|
||||
conf_yml := ``
|
||||
tempWarewulfConf, warewulfConfErr := os.CreateTemp("", "warewulf.conf-")
|
||||
assert.NoError(t, warewulfConfErr)
|
||||
defer os.Remove(tempWarewulfConf.Name())
|
||||
@@ -588,8 +550,7 @@ func Test_Node_Add(t *testing.T) {
|
||||
args: []string{"--tagadd=email=node", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
tags:
|
||||
@@ -598,8 +559,7 @@ nodes:
|
||||
n01:
|
||||
profiles:
|
||||
- default`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
tags:
|
||||
@@ -615,8 +575,7 @@ nodes:
|
||||
args: []string{"--tagadd=newtag=newval", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles:
|
||||
inDB: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
tags:
|
||||
@@ -627,8 +586,7 @@ nodes:
|
||||
- default
|
||||
tags:
|
||||
email: node`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles:
|
||||
outDb: `nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
tags:
|
||||
|
||||
Reference in New Issue
Block a user