Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pkg/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

ignv2_2types "github.com/coreos/ignition/config/v2_2/types"
"github.com/stretchr/testify/assert"
"github.com/vincent-petithory/dataurl"
)

Expand Down Expand Up @@ -86,3 +87,28 @@ func TestOverwrittenFile(t *testing.T) {
t.Errorf("Validating an overwritten file failed")
}
}

func TestDaemonOnceFromNoPanic(t *testing.T) {
exitCh := make(chan error)
defer close(exitCh)
stopCh := make(chan struct{})
defer close(stopCh)

// This is how a onceFrom daemon is initialized
// and it shouldn't panic assuming kubeClient is there
dn, err := New(
"/",
"testnodename",
"testos",
NewNodeUpdaterClient(),
NewFileSystemClient(),
"test",
false,
"",
NewNodeWriter(),
exitCh,
stopCh,
)
assert.Nil(t, err)
assert.NotPanics(t, func() { dn.triggerUpdateWithMachineConfig(nil, nil) })
}