X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Fcommandline.test;h=ba3d7171f9448d3de65028f21ce3c79effbfc8cf;hb=df687b5ca86b93e0801db54ba4bca0f81ff02548;hp=241cb25f172c2351b41ef0338019c5a29a263bdf;hpb=cfe507c299935bd231be698b8a426cc730f52936;p=tinc diff --git a/test/commandline.test b/test/commandline.test index 241cb25f..ba3d7171 100755 --- a/test/commandline.test +++ b/test/commandline.test @@ -28,9 +28,9 @@ tincd foo -D --net foo echo [STEP] Test tincd command line options that should not work -must_fail tincd foo foo -must_fail tincd foo --pidfile -must_fail tincd foo --foo +expect_code "$EXIT_FAILURE" tincd foo foo +expect_code "$EXIT_FAILURE" tincd foo --pidfile +expect_code "$EXIT_FAILURE" tincd foo --foo echo [STEP] Test tinc command line options that should work @@ -42,7 +42,23 @@ tinc foo --net foo get name echo [STEP] Test tinc command line options that should not work -must_fail tinc foo -n foo get somethingreallyunknown -must_fail tinc foo --net -must_fail tinc foo --net get name -must_fail tinc foo foo +expect_code "$EXIT_FAILURE" tinc foo -n foo get somethingreallyunknown +expect_code "$EXIT_FAILURE" tinc foo --net +expect_code "$EXIT_FAILURE" tinc foo --net get name +expect_code "$EXIT_FAILURE" tinc foo foo + +# Most of these should fail with ASAN. Some leaks are only detected by Valgrind. +echo [STEP] Trigger previously known memory leaks + +tincd foo -c . -c . --help +tincd foo -n net -n net --help +tincd foo -n net -o FakeOpt=42 --help +tincd foo --logfile=one --logfile=two --help +tincd foo --pidfile=one --pidfile=two --help +expect_code "$EXIT_FAILURE" tincd foo -n net -o Compression= --help +expect_code "$EXIT_FAILURE" tincd foo -c fakedir -n 'n/e\t' + +tinc foo -c conf -c conf --help +tinc foo -n net -n net --help +tinc foo --pidfile=pid --pidfile=pid --help +expect_code "$EXIT_FAILURE" tinc foo -c conf -n 'n/e\t'