Dir lookup test.

This commit is contained in:
Ivan Baravy 2019-11-09 01:37:01 +03:00
parent f4bdf82811
commit 017bca9dee
7 changed files with 134 additions and 67 deletions

View File

@ -1,6 +1,6 @@
MKDIRRANGE=../tools/mkdirrange
MKFILEPATTERN=../tools/mkfilepattern
MOUNT_OPT=
MOUNT_OPT=-t xfs
TEMP_DIR:=$(shell mktemp -d)
all: xfs_v4_ftype0_s05k_b2k_n8k.img xfs_v4_ftype1_s05k_b2k_n8k.img xfs_v4_xattr.img xfs_v4_files_s05k_b4k_n8k.img xfs_v4_deep_btree_dirs.img

12
kofu.c
View File

@ -366,12 +366,12 @@ typedef struct {
func_table_t funcs[] = {
{ "disk_add", kofu_disk_add },
{ "disk_del", kofu_disk_del },
{ "ls", kofu_ls },
{ "stat", kofu_stat },
{ "read", kofu_read },
{ "pwd", kofu_pwd },
{ "cd", kofu_cd },
{ NULL, NULL },
{ "ls", kofu_ls },
{ "stat", kofu_stat },
{ "read", kofu_read },
{ "pwd", kofu_pwd },
{ "cd", kofu_cd },
{ NULL, NULL },
};
void usage() {

View File

@ -1,44 +1,10 @@
/> disk_add ../img/xfs_v4_ftype0_s05k_b2k_n8k.img hd0
/> disk_add ../img/xfs_v4_files_s05k_b4k_n8k.img hd0
/hd0/1: xfs
/> stat /hd0/1/sf/.
/> stat /hd0/1/
status = 0 success
attr: ----f
/> stat /hd0/1/sf/..
/> stat /hd0/1/hole_begin
status = 0 success
attr: ----f
/> stat /hd0/1/sf///
status = 0 success
attr: ----f
/> stat /hd0/1/sf///.
status = 0 success
attr: ----f
/> stat /hd0/1/sf///..
status = 0 success
attr: ----f
/> stat /hd0/1/sf/../sf
status = 0 success
attr: ----f
/> stat /hd0/1/sf/../sf/
status = 0 success
attr: ----f
#stat /hd0/1/sf///..//sf
#stat /hd0/1/sf///..//sf/
/> stat /hd0/1/sf/d0000000000_
status = 0 success
attr: ----f
/> stat /hd0/1/sf/d0000000001_x
status = 0 success
attr: ----f
/> stat /hd0/1/sf/d0000000002_xx
status = 0 success
attr: ----f
/> stat /hd0/1/sf/d0000000003_xxx
status = 5 file_not_found
/> cd /hd0/1/sf
sf> stat d0000000001_x
status = 0 success
attr: ----f
sf> stat d0000000003_xxx
status = 5 file_not_found
attr: -----
size: 65536
/> disk_del hd0

View File

@ -1,19 +1,4 @@
disk_add ../img/xfs_v4_ftype0_s05k_b2k_n8k.img hd0
stat /hd0/1/sf/.
stat /hd0/1/sf/..
stat /hd0/1/sf///
stat /hd0/1/sf///.
stat /hd0/1/sf///..
stat /hd0/1/sf/../sf
stat /hd0/1/sf/../sf/
#stat /hd0/1/sf///..//sf
#stat /hd0/1/sf///..//sf/
stat /hd0/1/sf/d0000000000_
stat /hd0/1/sf/d0000000001_x
stat /hd0/1/sf/d0000000002_xx
stat /hd0/1/sf/d0000000003_xxx
cd /hd0/1/sf
stat d0000000001_x
stat d0000000003_xxx
disk_add ../img/xfs_v4_files_s05k_b4k_n8k.img hd0
stat /hd0/1/
stat /hd0/1/hole_begin
disk_del hd0

80
test/007_f70lookup.ref Normal file
View File

@ -0,0 +1,80 @@
/> disk_add ../img/xfs_v4_ftype1_s05k_b2k_n8k.img hd0
/hd0/1: xfs
/> stat /hd0/1/sf/.
status = 0 success
attr: ----f
/> stat /hd0/1/sf/..
status = 0 success
attr: ----f
/> stat /hd0/1/sf///
status = 0 success
attr: ----f
/> stat /hd0/1/sf///.
status = 0 success
attr: ----f
/> stat /hd0/1/sf///..
status = 0 success
attr: ----f
/> stat /hd0/1/sf/../sf
status = 0 success
attr: ----f
/> stat /hd0/1/sf/../sf/
status = 0 success
attr: ----f
#stat /hd0/1/sf///..//sf
#stat /hd0/1/sf///..//sf/
/> stat /hd0/1/sf/d0000000000_
status = 0 success
attr: ----f
/> stat /hd0/1/sf/d0000000001_x
status = 0 success
attr: ----f
/> stat /hd0/1/sf/d0000000002_xx
status = 0 success
attr: ----f
/> stat /hd0/1/sf/d0000000003_xxx
status = 5 file_not_found
/> cd /hd0/1/sf
sf> stat .
status = 0 success
attr: ----f
sf> stat ..
status = 0 success
attr: ----f
sf> stat d0000000001_x
status = 0 success
attr: ----f
sf> stat d0000000002_xx
status = 0 success
attr: ----f
sf> stat d0000000003_xxx
status = 5 file_not_found
sf> cd /hd0/1/block
block> stat .
status = 0 success
attr: ----f
block> stat ..
status = 0 success
attr: ----f
block> stat d0000000000_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
status = 0 success
attr: ----f
block> stat d0000000001_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
status = 0 success
attr: ----f
block> stat d0000000002_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
status = 0 success
attr: ----f
block> stat d0000000003_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
status = 0 success
attr: ----f
block> stat d0000000004_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
status = 0 success
attr: ----f
block> stat d0000000005_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
status = 5 file_not_found
block> disk_del hd0

34
test/007_f70lookup.t Normal file
View File

@ -0,0 +1,34 @@
disk_add ../img/xfs_v4_ftype1_s05k_b2k_n8k.img hd0
stat /hd0/1/sf/.
stat /hd0/1/sf/..
stat /hd0/1/sf///
stat /hd0/1/sf///.
stat /hd0/1/sf///..
stat /hd0/1/sf/../sf
stat /hd0/1/sf/../sf/
#stat /hd0/1/sf///..//sf
#stat /hd0/1/sf///..//sf/
stat /hd0/1/sf/d0000000000_
stat /hd0/1/sf/d0000000001_x
stat /hd0/1/sf/d0000000002_xx
stat /hd0/1/sf/d0000000003_xxx
cd /hd0/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xxxxxxxxxxxxxxxxxxxx
stat d0000000004_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
stat d0000000005_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
disk_del hd0

View File

@ -5,16 +5,18 @@ f30_tests := $(addsuffix .out, $(basename $(wildcard ???_f30_*.t)))
f70s0_tests := $(addsuffix .out, $(basename $(wildcard ???_f70s0_*.t)))
f70s1_tests := $(addsuffix .out, $(basename $(wildcard ???_f70s1_*.t)))
f70s5_tests := $(addsuffix .out, $(basename $(wildcard ???_f70s5_*.t)))
f70lookup_tests := $(addsuffix .out, $(basename $(wildcard ???_f70lookup*.t)))
all: f30 f70
@echo all tests passed
f30: $(f30_tests)
f70: f70s0 f70s1 f70s5
f70: f70s0 f70s1 f70s5 f70lookup
f70s0: $(f70s0_tests)
f70s1: $(f70s1_tests)
f70s5: $(f70s5_tests)
f70lookup: $(f70lookup_tests)
%.out: %.ref %.t
$(KOFU) < $(word 2, $^) > $@