xref: /aosp_15_r20/external/e2fsprogs/tests/f_dup4/script (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Workerif ! test -x $DEBUGFS_EXE; then
2*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: skipped (no debugfs)"
3*6a54128fSAndroid Build Coastguard Worker	return 0
4*6a54128fSAndroid Build Coastguard Workerfi
5*6a54128fSAndroid Build Coastguard Worker
6*6a54128fSAndroid Build Coastguard WorkerSKIP_GUNZIP="true"
7*6a54128fSAndroid Build Coastguard WorkerTEST_DATA="$test_name.tmp"
8*6a54128fSAndroid Build Coastguard Worker
9*6a54128fSAndroid Build Coastguard Workerecho "/ Murphy Magic.  The SeCrEt of the UnIvErSe is 43, NOT 42" > $TEST_DATA
10*6a54128fSAndroid Build Coastguard Worker
11*6a54128fSAndroid Build Coastguard Workertouch $TMPFILE
12*6a54128fSAndroid Build Coastguard Worker$MKE2FS -N 32 -F -o Linux -b 1024 $TMPFILE 100 > /dev/null 2>&1
13*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1
14*6a54128fSAndroid Build Coastguard Workerset_current_time 20070410210000
15*6a54128fSAndroid Build Coastguard Workerset_super_value lastcheck 0
16*6a54128fSAndroid Build Coastguard Workerset_super_value hash_seed null
17*6a54128fSAndroid Build Coastguard Workerset_super_value mkfs_time 0
18*6a54128fSAndroid Build Coastguard Workermkdir dir
19*6a54128fSAndroid Build Coastguard Workermkdir dir2
20*6a54128fSAndroid Build Coastguard Workermkdir dir3
21*6a54128fSAndroid Build Coastguard Workermkdir dir4
22*6a54128fSAndroid Build Coastguard Workercd /dir
23*6a54128fSAndroid Build Coastguard Workerwrite $TEST_DATA foo
24*6a54128fSAndroid Build Coastguard Workercd /dir2
25*6a54128fSAndroid Build Coastguard Workerwrite $TEST_DATA bar
26*6a54128fSAndroid Build Coastguard Workercd /dir3
27*6a54128fSAndroid Build Coastguard Workerwrite $TEST_DATA baz
28*6a54128fSAndroid Build Coastguard Workercd /dir4
29*6a54128fSAndroid Build Coastguard Workerwrite $TEST_DATA quux
30*6a54128fSAndroid Build Coastguard Workermkdir /dir/fee
31*6a54128fSAndroid Build Coastguard Workermkdir /dir2/fie
32*6a54128fSAndroid Build Coastguard Workermkdir /dir3/foe
33*6a54128fSAndroid Build Coastguard Workermkdir /dir4/fum
34*6a54128fSAndroid Build Coastguard Workerlink /dir/foo /dir2/foo1
35*6a54128fSAndroid Build Coastguard Workerlink /dir/foo /dir3/foo2
36*6a54128fSAndroid Build Coastguard Workerlink /dir2/bar /dir3/bar1
37*6a54128fSAndroid Build Coastguard Workerlink /dir4/quux /dir/quux1
38*6a54128fSAndroid Build Coastguard Workerlink /dir4/quux /dir2/quux2
39*6a54128fSAndroid Build Coastguard Workerset_inode_field /dir/foo block[0] 30
40*6a54128fSAndroid Build Coastguard Workerset_inode_field /dir2/bar block[0] 30
41*6a54128fSAndroid Build Coastguard Workerset_inode_field /dir3/baz block[0] 30
42*6a54128fSAndroid Build Coastguard Workerset_inode_field /dir/fee block[0] 34
43*6a54128fSAndroid Build Coastguard Workerset_inode_field /dir2/fie block[0] 34
44*6a54128fSAndroid Build Coastguard Workerset_inode_field /dir3/foe block[0] 34
45*6a54128fSAndroid Build Coastguard Workerq
46*6a54128fSAndroid Build Coastguard WorkerEOF
47*6a54128fSAndroid Build Coastguard Worker
48*6a54128fSAndroid Build Coastguard WorkerE2FSCK_TIME=200704102100
49*6a54128fSAndroid Build Coastguard Workerexport E2FSCK_TIME
50*6a54128fSAndroid Build Coastguard Worker
51*6a54128fSAndroid Build Coastguard Worker. $cmd_dir/run_e2fsck
52*6a54128fSAndroid Build Coastguard Worker
53*6a54128fSAndroid Build Coastguard Workerrm -f $TEST_DATA
54*6a54128fSAndroid Build Coastguard Worker
55*6a54128fSAndroid Build Coastguard Workerunset E2FSCK_TIME TEST_DATA
56