diff --git a/testing/baselines/tests.bundle-permissions/bundle.out b/testing/baselines/tests.bundle-permissions/bundle.out index 6b5a4b9..a571d32 100644 --- a/testing/baselines/tests.bundle-permissions/bundle.out +++ b/testing/baselines/tests.bundle-permissions/bundle.out @@ -1,38 +1,38 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -drwxr-xr-x root/root ./ -drwxr-xr-x root/root ./baz/ --rw-r--r-- root/root ./baz/__load__.zeek --rw-r--r-- root/root ./baz/zkg.meta --rw-r--r-- root/root ./manifest.txt -drwxr-xr-x root/root ./rot13/ --rw-r--r-- root/root ./rot13/CHANGES --rw-r--r-- root/root ./rot13/CMakeLists.txt --rw-r--r-- root/root ./rot13/COPYING.edit-me --rw-r--r-- root/root ./rot13/Makefile --rw-r--r-- root/root ./rot13/README --rw-r--r-- root/root ./rot13/VERSION --rwxr-xr-x root/root ./rot13/configure --rw-r--r-- root/root ./rot13/configure.plugin -drwxr-xr-x root/root ./rot13/scripts/ -drwxr-xr-x root/root ./rot13/scripts/Demo/ -drwxr-xr-x root/root ./rot13/scripts/Demo/Rot13/ --rw-r--r-- root/root ./rot13/scripts/Demo/Rot13/__load__.zeek --rw-r--r-- root/root ./rot13/scripts/__load__.zeek --rw-r--r-- root/root ./rot13/scripts/__preload__.zeek --rw-r--r-- root/root ./rot13/scripts/init.zeek --rw-r--r-- root/root ./rot13/scripts/types.zeek -drwxr-xr-x root/root ./rot13/src/ --rw-r--r-- root/root ./rot13/src/Plugin.cc --rw-r--r-- root/root ./rot13/src/Plugin.h --rw-r--r-- root/root ./rot13/src/rot13.bif -drwxr-xr-x root/root ./rot13/testing/ -drwxr-xr-x root/root ./rot13/testing/Baseline/ -drwxr-xr-x root/root ./rot13/testing/Baseline/tests.main/ --rw-r--r-- root/root ./rot13/testing/Baseline/tests.main/output -drwxr-xr-x root/root ./rot13/testing/Baseline/tests.rot13/ --rw-r--r-- root/root ./rot13/testing/Baseline/tests.rot13/output --rw-r--r-- root/root ./rot13/testing/btest.cfg -drwxr-xr-x root/root ./rot13/testing/tests/ --rw-r--r-- root/root ./rot13/testing/tests/main --rw-r--r-- root/root ./rot13/testing/tests/rot13 --rw-r--r-- root/root ./rot13/zkg.meta +drwxr-xr-x ./ +drwxr-xr-x ./baz/ +-rw-r--r-- ./baz/__load__.zeek +-rw-r--r-- ./baz/zkg.meta +-rw-r--r-- ./manifest.txt +drwxr-xr-x ./rot13/ +-rw-r--r-- ./rot13/CHANGES +-rw-r--r-- ./rot13/CMakeLists.txt +-rw-r--r-- ./rot13/COPYING.edit-me +-rw-r--r-- ./rot13/Makefile +-rw-r--r-- ./rot13/README +-rw-r--r-- ./rot13/VERSION +-rwxr-xr-x ./rot13/configure +-rw-r--r-- ./rot13/configure.plugin +drwxr-xr-x ./rot13/scripts/ +drwxr-xr-x ./rot13/scripts/Demo/ +drwxr-xr-x ./rot13/scripts/Demo/Rot13/ +-rw-r--r-- ./rot13/scripts/Demo/Rot13/__load__.zeek +-rw-r--r-- ./rot13/scripts/__load__.zeek +-rw-r--r-- ./rot13/scripts/__preload__.zeek +-rw-r--r-- ./rot13/scripts/init.zeek +-rw-r--r-- ./rot13/scripts/types.zeek +drwxr-xr-x ./rot13/src/ +-rw-r--r-- ./rot13/src/Plugin.cc +-rw-r--r-- ./rot13/src/Plugin.h +-rw-r--r-- ./rot13/src/rot13.bif +drwxr-xr-x ./rot13/testing/ +drwxr-xr-x ./rot13/testing/Baseline/ +drwxr-xr-x ./rot13/testing/Baseline/tests.main/ +-rw-r--r-- ./rot13/testing/Baseline/tests.main/output +drwxr-xr-x ./rot13/testing/Baseline/tests.rot13/ +-rw-r--r-- ./rot13/testing/Baseline/tests.rot13/output +-rw-r--r-- ./rot13/testing/btest.cfg +drwxr-xr-x ./rot13/testing/tests/ +-rw-r--r-- ./rot13/testing/tests/main +-rw-r--r-- ./rot13/testing/tests/rot13 +-rw-r--r-- ./rot13/zkg.meta diff --git a/testing/tests/bundle-permissions b/testing/tests/bundle-permissions index b353f31..e985548 100644 --- a/testing/tests/bundle-permissions +++ b/testing/tests/bundle-permissions @@ -32,3 +32,21 @@ cat << EOF > my_zkg.config state_dir = $(pwd)/state EOF + +# @TEST-START-FILE list-dir.py +#!/usr/bin/env python3 + +"""System-independent helper to print permissions of entries in directories.""" + +import os +import stat +import sys +from pathlib import Path + +DIRS = map(lambda d: Path(d), sys.argv[1:]) +for d in DIRS: + for e in sorted(os.listdir(d)): + f = d / e + s = os.stat(f, follow_symlinks=False) + print(f"{stat.filemode(s.st_mode)} {f}") +# @TEST-END-FILE