Skip to content

Commit

Permalink
daemon: fixup tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Batschelet <[email protected]>
  • Loading branch information
hexfusion committed Jan 24, 2024
1 parent 35cfd63 commit 2881ef8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (f *fixture) newController() *Daemon {
i.Machineconfiguration().V1().MachineConfigs(),
k8sI.Core().V1().Nodes(),
i.Machineconfiguration().V1().ControllerConfigs(),
i.Machineconfiguration().V1().PinnedImageSets(),
false,
"",
d.featureGatesAccessor,
Expand Down
8 changes: 8 additions & 0 deletions pkg/daemon/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ func TestCalculatePostConfigChangeAction(t *testing.T) {
"policy2": ctrlcommon.NewIgnFile("/etc/containers/policy.json", "policy2"),
"containers-gpg1": ctrlcommon.NewIgnFile("/etc/machine-config-daemon/no-reboot/containers-gpg.pub", "containers-gpg1"),
"containers-gpg2": ctrlcommon.NewIgnFile("/etc/machine-config-daemon/no-reboot/containers-gpg.pub", "containers-gpg2"),
"pinned-images1": ctrlcommon.NewIgnFile("/etc/crio/crio.conf.d/01-pinned-images", "image set 1"),
"pinned-images2": ctrlcommon.NewIgnFile("/etc/crio/crio.conf.d/01-pinned-images", "image set 2"),
}

tests := []struct {
Expand Down Expand Up @@ -745,6 +747,12 @@ func TestCalculatePostConfigChangeAction(t *testing.T) {
newConfig: helpers.NewMachineConfig("01-test", nil, "dummy://", []ign3types.File{files["containers-gpg2"]}),
expectedAction: []string{postConfigChangeActionReloadCrio},
},
{
// test that updating pinned-images is crio reload
oldConfig: helpers.NewMachineConfig("00-test", nil, "dummy://", []ign3types.File{files["pinned-images1"]}),
newConfig: helpers.NewMachineConfig("01-test", nil, "dummy://", []ign3types.File{files["pinned-images2"]}),
expectedAction: []string{postConfigChangeActionReloadCrio},
},
}

for idx, test := range tests {
Expand Down
1 change: 1 addition & 0 deletions pkg/daemon/upgrade_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (tc upgradeMonitorTestCase) run(t *testing.T) {
i.Machineconfiguration().V1().MachineConfigs(),
k8sI.Core().V1().Nodes(),
i.Machineconfiguration().V1().ControllerConfigs(),
i.Machineconfiguration().V1().PinnedImageSets(),
false,
"",
fgAccess,
Expand Down

0 comments on commit 2881ef8

Please sign in to comment.