From 9fe38edec0308a121b1a76be1858b56c019ce3b7 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 7 Aug 2019 18:13:52 +0200 Subject: [PATCH] netconfig_test: force an order for IP address golden output --- integration/netconfig/netconfig_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/integration/netconfig/netconfig_test.go b/integration/netconfig/netconfig_test.go index 92bd53c..6a5a3ac 100644 --- a/integration/netconfig/netconfig_test.go +++ b/integration/netconfig/netconfig_test.go @@ -384,7 +384,13 @@ peer: ScxV5nQsUIaaOp3qdwPqRcgMkR3oR6nyi1tBLUovqBs= peer: AVU3LodtnFaFnJmMyNNW7cUk4462lqnVULTFkjWYvRo= endpoint: [::1]:12345 allowed ips: 10.0.0.0/8` - if got := strings.TrimSpace(string(out)); got != want { + got := strings.TrimSpace(string(out)) + // Enforce an order (it can change, or did change between kernel + // versions): + got = strings.ReplaceAll(got, + " allowed ips: fe80::/64, 10.0.137.0/24", + " allowed ips: 10.0.137.0/24, fe80::/64") + if got != want { t.Fatalf("unexpected wg output: diff (-want +got):\n%s", diff.LineDiff(want, got)) }