Remove DEBUG logging in test suite

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-12-17 00:42:45 -07:00
parent 1a3d037703
commit deaf9c99d7
9 changed files with 0 additions and 21 deletions

View File

@@ -5,11 +5,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/warewulf/warewulf/internal/pkg/testenv"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
func Test_Clean(t *testing.T) {
wwlog.SetLogLevel(wwlog.DEBUG)
env := testenv.New(t)
env.WriteFile(t, "etc/warewulf/nodes.conf",
`nodeprofiles: {}

View File

@@ -7,7 +7,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/warewulf/warewulf/internal/pkg/testenv"
"github.com/warewulf/warewulf/internal/pkg/warewulfd"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
type test_description struct {
@@ -22,7 +21,6 @@ type test_description struct {
func run_test(t *testing.T, test test_description) {
env := testenv.New(t)
defer env.RemoveAll(t)
wwlog.SetLogLevel(wwlog.DEBUG)
env.WriteFile(t, "etc/warewulf/nodes.conf", test.inDB)
warewulfd.SetNoDaemon()
name := test.name

View File

@@ -8,7 +8,6 @@ import (
"github.com/warewulf/warewulf/internal/pkg/testenv"
"github.com/warewulf/warewulf/internal/pkg/warewulfd"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
type test_description struct {
@@ -23,7 +22,6 @@ type test_description struct {
func run_test(t *testing.T, test test_description) {
env := testenv.New(t)
defer env.RemoveAll(t)
wwlog.SetLogLevel(wwlog.DEBUG)
env.WriteFile(t, "etc/warewulf/nodes.conf", test.inDB)
warewulfd.SetNoDaemon()
name := test.name

View File

@@ -8,13 +8,11 @@ import (
"github.com/stretchr/testify/assert"
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
"github.com/warewulf/warewulf/internal/pkg/testenv"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
func Test_Find_ShimX86(t *testing.T) {
testenv.New(t)
conf := warewulfconf.Get()
wwlog.SetLogLevel(wwlog.DEBUG)
_ = os.MkdirAll(path.Join(conf.Paths.WWChrootdir, "suse/rootfs/usr/lib64/efi/"), 0755)
shimF, err := os.Create(path.Join(conf.Paths.WWChrootdir, "suse/rootfs/usr/lib64/efi/shim.efi"))
assert.NoError(t, err)
@@ -26,7 +24,6 @@ func Test_Find_ShimX86(t *testing.T) {
func Test_Find_ShimArch64(t *testing.T) {
testenv.New(t)
conf := warewulfconf.Get()
wwlog.SetLogLevel(wwlog.DEBUG)
_ = os.MkdirAll(path.Join(conf.Paths.WWChrootdir, "suse/rootfs/usr/share/efi/aarch64"), 0755)
shimF, err := os.Create(path.Join(conf.Paths.WWChrootdir, "suse/rootfs/usr/share/efi/aarch64/shim.efi"))
assert.NoError(t, err)
@@ -38,7 +35,6 @@ func Test_Find_ShimArch64(t *testing.T) {
func Test_Find_GrubX86(t *testing.T) {
testenv.New(t)
conf := warewulfconf.Get()
wwlog.SetLogLevel(wwlog.DEBUG)
_ = os.MkdirAll(path.Join(conf.Paths.WWChrootdir, "suse/rootfs/usr/share/efi/x86_64"), 0755)
shimF, err := os.Create(path.Join(conf.Paths.WWChrootdir, "suse/rootfs/usr/share/efi/x86_64/grub.efi"))
assert.NoError(t, err)
@@ -50,7 +46,6 @@ func Test_Find_GrubX86(t *testing.T) {
func Test_Find_GrubAarch64(t *testing.T) {
testenv.New(t)
conf := warewulfconf.Get()
wwlog.SetLogLevel(wwlog.DEBUG)
_ = os.MkdirAll(path.Join(conf.Paths.WWChrootdir, "suse/rootfs/usr/share/efi/aarch64/"), 0755)
shimF, err := os.Create(path.Join(conf.Paths.WWChrootdir, "suse/rootfs/usr/share/efi/aarch64/grub.efi"))
assert.NoError(t, err)

View File

@@ -4,7 +4,6 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
"gopkg.in/yaml.v3"
)
@@ -196,7 +195,6 @@ nodes:
var ymlSrc NodesYaml
err := yaml.Unmarshal([]byte(nodesconf), &ymlSrc)
assert.NoError(err)
wwlog.SetLogLevel(wwlog.DEBUG)
nodes, err := ymlSrc.FindAllNodes()
assert.NoError(err)
nodemap := make(map[string]*Node)

View File

@@ -4,7 +4,6 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
"gopkg.in/yaml.v3"
)
@@ -92,7 +91,6 @@ func Test_nodeYaml_FindByHwaddr(t *testing.T) {
}
func Test_nodeYaml_FindByIpaddr(t *testing.T) {
wwlog.SetLogLevel(wwlog.DEBUG)
c, err := NewUtilTestNode()
assert.NoError(t, err)
type args struct {

View File

@@ -5,7 +5,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/warewulf/warewulf/internal/pkg/node"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
func Test_createIgnitionJson(t *testing.T) {
@@ -51,7 +50,6 @@ func Test_createIgnitionJson(t *testing.T) {
]
}
}`
wwlog.SetLogLevel(wwlog.DEBUG)
config, parse_error := node.Parse([]byte(node_config))
assert.Empty(t, parse_error)

View File

@@ -7,7 +7,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/warewulf/warewulf/internal/pkg/testenv"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
var nodesYamlUpgradeTests = []struct {
@@ -753,7 +752,6 @@ nodes:
}
func Test_UpgradeNodesYaml(t *testing.T) {
wwlog.SetLogLevel(wwlog.DEBUG)
for _, tt := range nodesYamlUpgradeTests {
t.Run(tt.name, func(t *testing.T) {
env := testenv.New(t)

View File

@@ -12,7 +12,6 @@ import (
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
"github.com/warewulf/warewulf/internal/pkg/testenv"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
var provisionSendTests = []struct {
@@ -93,7 +92,6 @@ nodes:
assert.NoError(t, os.WriteFile(path.Join(conf.Paths.OverlayProvisiondir(), "n1", "__RUNTIME__.img"), []byte("runtime overlay"), 0600))
assert.NoError(t, os.WriteFile(path.Join(conf.Paths.OverlayProvisiondir(), "n1", "o1.img"), []byte("specific overlay"), 0600))
wwlog.SetLogLevel(wwlog.DEBUG)
for _, tt := range provisionSendTests {
t.Run(tt.description, func(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, tt.url, nil)