diff --git a/dhcp4/conn_test.go b/dhcp4/conn_test.go index 9654ebe..f15b0dc 100644 --- a/dhcp4/conn_test.go +++ b/dhcp4/conn_test.go @@ -20,7 +20,7 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func testConn(t *testing.T, impl conn, addr string) { @@ -55,7 +55,7 @@ func testConn(t *testing.T, impl conn, addr string) { go func() { _, err := s.Write(bs) - assert.NoError(t, err) + require.NoError(t, err) }() if err = c.SetReadDeadline(time.Now().Add(time.Second)); err != nil { t.Fatal(err) @@ -86,7 +86,7 @@ func testConn(t *testing.T, impl conn, addr string) { ch := make(chan *Packet, 1) go func() { err := s.SetReadDeadline(time.Now().Add(time.Second)) - assert.NoError(t, err) + require.NoError(t, err) var buf [1500]byte n, err := s.Read(buf[:]) if err != nil { diff --git a/dhcp6/pool/random_address_pool_test.go b/dhcp6/pool/random_address_pool_test.go index 4be416d..28cf64b 100644 --- a/dhcp6/pool/random_address_pool_test.go +++ b/dhcp6/pool/random_address_pool_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestReserveAddress(t *testing.T) { @@ -60,7 +60,7 @@ func TestReserveAddressUpdatesAddressPool(t *testing.T) { pool := NewRandomAddressPool(net.ParseIP("2001:db8:f00f:cafe::1"), 1, expectedMaxLifetime) pool.timeNow = func() time.Time { return expectedTime } _, err := pool.ReserveAddresses(expectedClientID, [][]byte{expectedIAID}) - assert.NoError(t, err) + require.NoError(t, err) expectedIdx := pool.calculateIAIDHash(expectedClientID, expectedIAID) @@ -83,7 +83,7 @@ func TestReserveAddressKeepsTrackOfUsedAddresses(t *testing.T) { pool := NewRandomAddressPool(net.ParseIP("2001:db8:f00f:cafe::1"), 1, expectedMaxLifetime) pool.timeNow = func() time.Time { return expectedTime } _, err := pool.ReserveAddresses(expectedClientID, [][]byte{expectedIAID}) - assert.NoError(t, err) + require.NoError(t, err) _, exists := pool.usedIps[0x01] if !exists { t.Fatal("'2001:db8:f00f:cafe::1' should be marked as in use") @@ -99,8 +99,8 @@ func TestReserveAddressKeepsTrackOfAssociationExpiration(t *testing.T) { pool := NewRandomAddressPool(net.ParseIP("2001:db8:f00f:cafe::1"), 1, expectedMaxLifetime) pool.timeNow = func() time.Time { return expectedTime } _, err := pool.ReserveAddresses(expectedClientID, [][]byte{expectedIAID}) - assert.NoError(t, err) - + require.NoError(t, err) + expiration := pool.identityAssociationExpirations.Peek().(*associationExpiration) if expiration == nil { t.Fatal("Expected an identity association expiration, but got nil") diff --git a/pixiecore/booters.go b/pixiecore/booters.go index 8eeeacb..8a33e5f 100644 --- a/pixiecore/booters.go +++ b/pixiecore/booters.go @@ -28,9 +28,10 @@ import ( "text/template" "time" + "go.uber.org/zap" + v1 "github.com/metal-stack/metal-api/pkg/api/v1" "github.com/metal-stack/pixie/api" - "go.uber.org/zap" ) // APIBooter gets a BootSpec from a remote server over HTTP. @@ -111,14 +112,14 @@ func (g *grpcbooter) BootSpec(m Machine) (*Spec, error) { } g.log.Infow("boot", "resp", resp) - cmdline := []string{*resp.Cmdline, fmt.Sprintf("PIXIE_API_URL=%s", g.config.PixieAPIURL)} + cmdline := []string{resp.GetCmdline(), fmt.Sprintf("PIXIE_API_URL=%s", g.config.PixieAPIURL)} if g.config.Debug { cmdline = append(cmdline, "DEBUG=1") } r = rawSpec{ - Kernel: resp.Kernel, - Initrd: resp.InitRamDisks, + Kernel: resp.GetKernel(), + Initrd: resp.GetInitRamDisks(), Cmdline: strings.Join(cmdline, " "), } }