>From d88957e9572e69490e109526f905745555fe8589 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 11 Sep 2019 14:54:49 +0100 Subject: [PATCH] tests/test-full.sh: Refactor to tests into a single function (NOT WORKING). --- tests/test-full.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/tests/test-full.sh b/tests/test-full.sh index 8f237dd..f060f4f 100755 --- a/tests/test-full.sh +++ b/tests/test-full.sh @@ -55,19 +55,15 @@ nbdsh --connect "nbd+unix://?socket=$sock" \ # All writes should fail with the ENOSPC error. nbdsh --connect "nbd+unix://?socket=$sock" \ -c ' -try: - h.pwrite (bytearray (512), 0) - # This should not happen. - exit (1) -except nbd.Error as ex: - # Check the errno is expected. - assert ex.errno == "ENOSPC" +def test (offset): + try: + h.pwrite (bytearray (512), offset) + # This should not happen. + exit (1) + except nbd.Error as ex: + # Check the errno is expected. + assert ex.errno == "ENOSPC" -try: - h.pwrite (bytearray (512), 1048064) - # This should not happen. - exit (1) -except nbd.Error as ex: - # Check the errno is expected. - assert ex.errno == "ENOSPC" +test (0) +test (1048064) ' -- 2.23.0