diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-06-05 14:07:07 +0200 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-06-05 14:07:07 +0200 |
commit | f42715a4ced0c445d3a8636617cc5d40fb1e443a (patch) | |
tree | f50992c1fea1f12b4a31f8fe8b0dbca2de2b6075 | |
parent | 12129d46981106fa0d356cfd6000d6006942f0e4 (diff) | |
download | seitan-f42715a4ced0c445d3a8636617cc5d40fb1e443a.tar seitan-f42715a4ced0c445d3a8636617cc5d40fb1e443a.tar.gz seitan-f42715a4ced0c445d3a8636617cc5d40fb1e443a.tar.bz2 seitan-f42715a4ced0c445d3a8636617cc5d40fb1e443a.tar.lz seitan-f42715a4ced0c445d3a8636617cc5d40fb1e443a.tar.xz seitan-f42715a4ced0c445d3a8636617cc5d40fb1e443a.tar.zst seitan-f42715a4ced0c445d3a8636617cc5d40fb1e443a.zip |
demo: extend demo with additional matches
Add matches for injecting error and faking the connect syscall.
Fix seitan-run clean-up: delete only *.bpf and *.gluten files
-rw-r--r-- | demo/connect.hjson | 14 | ||||
-rwxr-xr-x | seitan-run | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/demo/connect.hjson b/demo/connect.hjson index 91d5af1..f3a9ad8 100644 --- a/demo/connect.hjson +++ b/demo/connect.hjson @@ -1,5 +1,11 @@ [ - { + { /* fake connect syscall */ + "match": [ + { "connect": { "addr": { "family": "unix", "path": "/fake.sock" } } } + ], + "return": 0 + }, + { /* connect to another path (/var/run/pr-helper.sock -> /tmp/demo.sock) */ "match": [ { "connect": { "addr": { "family": "unix", "path": "/var/run/pr-helper.sock" }, "fd": { "tag": "fd" } } } ], @@ -9,5 +15,11 @@ ], "fd": { "src": { "tag": "fd" }, "new": { "tag": "new_fd" }, "close_on_exec": false }, "return": 0 + }, + { /* Inject permission denied error */ + "match": [ + { "connect": { "addr": { "family": "unix", "path": "/error.sock" } } } + ], + "block": -1 } ] @@ -16,7 +16,8 @@ usage() { } cleanup() { - rm -rf "${DIR}" + rm -rf "${DIR}/*.bpf" + rm -rf "${DIR}/*.gluten" } trap cleanup EXIT INT |