Skip to content

Commit 681307a

Browse files
committed
[LibOS] Test-cases for SPLRB (2)
* New adverserial ones Signed-off-by: g2flyer <[email protected]>
1 parent bad1946 commit 681307a

File tree

7 files changed

+802
-0
lines changed

7 files changed

+802
-0
lines changed

libos/test/fs/gdb_helper.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import gdb
2+
import re
3+
import shutil
4+
5+
def adversary_do(cmd):
6+
# extract interesting info from context
7+
test_function=gdb.selected_frame().older().name()
8+
operation=gdb.selected_frame().name()
9+
internal_path=gdb.selected_frame().read_var('path').string()
10+
external_path=re.sub(r'/tmp/enc_input/', './tmp/enc_input/', internal_path)
11+
external_path_saved=external_path+"._saved_"
12+
13+
# execute and report result for pytest digestion
14+
try:
15+
cmd(external_path, external_path_saved)
16+
print(f"OK: {test_function} in {operation}({internal_path})")
17+
except:
18+
print(f"FAIL: {test_function} in {operation}({internal_path})")

libos/test/fs/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ tests = {
4242
},
4343
'open_close': {},
4444
'open_flags': {},
45+
'pf_rollback': {},
4546
'read_write': {},
4647
'read_write_mmap': {},
4748
'seek_tell': {},

0 commit comments

Comments
 (0)