From ac0c70f74a5badbebec721c2be0602ea98c0437b Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Thu, 27 Apr 2017 20:31:00 +0200 Subject: prog, executor: move checksum computation to executor This commit moves checksum computation to executor. This will allow to embed dynamically generated values (like TCP sequence numbers) into packets. --- executor/test_test.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'executor/test_test.go') diff --git a/executor/test_test.go b/executor/test_test.go index f197dbf51..368454ac3 100644 --- a/executor/test_test.go +++ b/executor/test_test.go @@ -5,8 +5,8 @@ package executor import "testing" -func TestCopyin(t *testing.T) { - switch res := testCopyin(); { +func testWrapper(t *testing.T, f func() int) { + switch res := f(); { case res < 0: t.Skip() case res > 0: @@ -15,12 +15,18 @@ func TestCopyin(t *testing.T) { } } +func TestCopyin(t *testing.T) { + testWrapper(t, testCopyin) +} + +func TestCsumInet(t *testing.T) { + testWrapper(t, testCsumInet) +} + +func TestCsumInetAcc(t *testing.T) { + testWrapper(t, testCsumInetAcc) +} + func TestKVM(t *testing.T) { - switch res := testKVM(); { - case res < 0: - t.Skip() - case res > 0: - t.Fail() - default: - } + testWrapper(t, testKVM) } -- cgit mrf-deployment