diff options
Diffstat (limited to 'src/suites/path.py')
| -rw-r--r-- | src/suites/path.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/suites/path.py b/src/suites/path.py index 13866de..5ac25ae 100644 --- a/src/suites/path.py +++ b/src/suites/path.py @@ -6,7 +6,7 @@ # By: charles <me@cacharle.xyz> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/09/09 15:12:58 by charles #+# #+# # -# Updated: 2020/10/08 08:41:38 by cacharle ### ########.fr # +# Updated: 2020/10/09 11:00:46 by cacharle ### ########.fr # # # # ############################################################################ # @@ -19,9 +19,9 @@ from suite import suite def suite_path(test): """ searching a command in the path tests """ whoami_path = distutils.spawn.find_executable("which") - mode_fmt = ("mkdir path && cp " + - whoami_path + - " ./path/a && chmod {} ./path/a") + mode_fmt = ("mkdir path && cp " + + whoami_path + + " ./path/a && chmod {} ./path/a") test("a", setup=mode_fmt.format("000"), exports={"PATH": "path"}) test("a", setup=mode_fmt.format("001"), exports={"PATH": "path"}) test("a", setup=mode_fmt.format("002"), exports={"PATH": "path"}) @@ -66,13 +66,13 @@ def suite_path(test): test("a", setup=mode_fmt.format("6777"), exports={"PATH": "path"}) test("a", setup=mode_fmt.format("7777"), exports={"PATH": "path"}) test("a", setup=mode_fmt.format("0000"), exports={"PATH": "path"}) - test("b", setup="mkdir path && cp " + whoami_path + " ./path/a && ln -s ./path/a ./path/b", - exports={"PATH": "path"}) + # test("b", setup="mkdir path && cp " + whoami_path + " ./path/a && ln -s ./path/a ./path/b", + # exports={"PATH": "path"}) test("b", setup="mkdir path && ln -s " + whoami_path + " ./path/b", exports={"PATH": "path"}) test("a", setup="mkdir path && mkfifo path/a") test("a", setup="mkdir path && mkfifo path/a && chmod 777 path/a") - test("a", setup="mkdir path1 path2 && cp " + whoami_path + " path1/a" - "&& cp " + whoami_path + " path2/a && chmod 000 path1/a", exports={"PATH": "path1:path2"}) + # test("a", setup="mkdir path1 path2 && cp " + whoami_path + " path1/a" + # "&& cp " + whoami_path + " path2/a && chmod 000 path1/a", exports={"PATH": "path1:path2"}) test("a", setup="mkdir path1 path2 && cp " + whoami_path + " path1/a" "&& cp " + whoami_path + " path2/a && chmod 000 path1/a", exports={"PATH": "path2:path1"}) @@ -106,6 +106,7 @@ def suite_path_variable(test): test("whoami", exports={"PATH": " /sbin "}) test("whoami", exports={"PATH": "/sbin:/sbin:/sbin:/sbin"}) test("whoami", exports={"PATH": ""}) # error message explicit enough + test("unset PATH; whoami") # error message explicit enough test("whoami", exports={"PATH": ":"}) test("whoami", exports={"PATH": ":::::::::::::::::::"}) test("whoami", exports={"PATH": "/asdfasdf"}) |
