From 7353a331ffe01cf112795ef95acc477d20c71c52 Mon Sep 17 00:00:00 2001 From: Jeffery Miller Date: Wed, 16 Apr 2025 18:54:02 -0500 Subject: [PATCH] tests/dd: Add conv=nocreat test cases Check that conv=nocreat errors out and does not not create a file. Test: make test_dd --- tests/dd.test | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/dd.test b/tests/dd.test index 9d8d7abf..11e869c9 100644 --- a/tests/dd.test +++ b/tests/dd.test @@ -100,6 +100,11 @@ testcmd "conv=sync" "conv=sync | head -n 1" "I WANT\n" "" "I WANT\n" testcmd "conv=sync with IF" "conv=sync if=input | head -n 1" "I WANT\n" \ "I WANT\n" "" +testcmd "conv=nocreat" "conv=nocreat of=./noexist || ( [ ! -e ./noexist ] && echo DOESNOTEXIST )" \ + "DOESNOTEXIST\n" "" "anything at all" +testcmd "conv=nocreat no OF" "conv=nocreat if=input" "anything" "anything" "" +testing "conv=nocreat exists" "dd conv=nocreat of=input && cat input" "results" "existing" "results" + # status=noxfer|none testcmd "status=noxfer" "if=input status=noxfer ibs=1 2>&1" \ "input\n6+0 records in\n0+1 records out\n" "input\n" "" -- 2.39.5