Skip to content

Commit

Permalink
fixup! Add btest for new permission handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannier committed Jul 25, 2024
1 parent cdd3b03 commit c67aeb3
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 37 deletions.
74 changes: 37 additions & 37 deletions testing/baselines/tests.bundle-permissions/bundle.out
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions testing/tests/bundle-permissions
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c67aeb3

Please sign in to comment.