Revision 9b72a5cf9c68e7b99230a45843583901812d2a08 authored by Daniel Borkmann on 03 May 2024, 13:39:42 UTC, committed by Daniel Borkmann on 03 May 2024, 13:56:45 UTC
Turn it off until we have a new v1.15 stable release with #32337 included.
Without the PR the IPSec downgrade test on v1.15 reported small blips of
connectivity interruption.

We can revert this commit once v1.15.5 is out.

Reported-by: Julian Wiedmann <jwi@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
1 parent 8552def
Raw File
byteorder_test.go
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

package byteorder

import (
	"encoding/binary"
	"net"
	"testing"

	"github.com/stretchr/testify/require"
)

func TestNativeIsInitialized(t *testing.T) {
	require.NotNil(t, Native)
}

func TestHostToNetwork(t *testing.T) {
	switch Native {
	case binary.LittleEndian:
		require.Equal(t, uint16(0xBBAA), HostToNetwork16(0xAABB))
		require.Equal(t, uint32(0xDDCCBBAA), HostToNetwork32(0xAABBCCDD))
	case binary.BigEndian:
		require.Equal(t, uint16(0xAABB), HostToNetwork16(0xAABB))
		require.Equal(t, uint32(0xAABBCCDD), HostToNetwork32(0xAABBCCDD))
	}
}

func TestNetIPv4ToHost32(t *testing.T) {
	switch Native {
	case binary.LittleEndian:
		require.Equal(t, uint32(0x5b810b0a), NetIPv4ToHost32(net.ParseIP("10.11.129.91")))
		require.Equal(t, uint32(0xd68a0b0a), NetIPv4ToHost32(net.ParseIP("10.11.138.214")))
	case binary.BigEndian:
		require.Equal(t, uint32(0x0a0b815b), NetIPv4ToHost32(net.ParseIP("10.11.129.91")))
		require.Equal(t, uint32(0x0a0b8ad6), NetIPv4ToHost32(net.ParseIP("10.11.138.214")))
	}
}
back to top