Skip to content

Commit

Permalink
[LibOS] Test-cases for SPLRB (2)
Browse files Browse the repository at this point in the history
* New adverserial ones

Signed-off-by: g2flyer <[email protected]>
  • Loading branch information
g2flyer committed Jun 14, 2024
1 parent bad1946 commit 681307a
Show file tree
Hide file tree
Showing 7 changed files with 802 additions and 0 deletions.
18 changes: 18 additions & 0 deletions libos/test/fs/gdb_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import gdb
import re
import shutil

def adversary_do(cmd):
# extract interesting info from context
test_function=gdb.selected_frame().older().name()
operation=gdb.selected_frame().name()
internal_path=gdb.selected_frame().read_var('path').string()
external_path=re.sub(r'/tmp/enc_input/', './tmp/enc_input/', internal_path)
external_path_saved=external_path+"._saved_"

# execute and report result for pytest digestion
try:
cmd(external_path, external_path_saved)
print(f"OK: {test_function} in {operation}({internal_path})")
except:
print(f"FAIL: {test_function} in {operation}({internal_path})")
1 change: 1 addition & 0 deletions libos/test/fs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ tests = {
},
'open_close': {},
'open_flags': {},
'pf_rollback': {},
'read_write': {},
'read_write_mmap': {},
'seek_tell': {},
Expand Down
Loading

0 comments on commit 681307a

Please sign in to comment.