summaryrefslogtreecommitdiffstats
path: root/c/src/tests/psxtests/psxreaddir/psxreaddir.scn
blob: 5259773924d650020633b033828a83c52aace757 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
*** READDIR TEST ***
chdir to the root directory
chdir() status : 0
Creating a series of directories under /
Creating directory: a      0 0    Success
Creating directory: b      0 0    Success
Creating directory: c      0 0    Success
Creating directory: d      0 0    Success
Creating directory: e      0 0    Success
Creating directory: f      0 0    Success
Creating directory: c/y      0 0    Success
Creating directory: c/z      0 0    Success
Creating directory: c/x      0 0    Success
Creating directory: c/y/a3333      0 0    Success
Creating directory: c/y/j123      0 0    Success
Create a lot of files
Create a
Create b
Create c
Create d
Create e
Create f
Create g
Create h
Create i
Create j
Create k
Create l
Create m
Create n
Create o
Create p
Create q
Create r
Create s
Create t
Create u
Create v
Create w
Create x
Create y
Create z
Create aa
Create ab
Create ac
Create ad
Create ae
Create af
Create ag
Create ah
Create ai
Create aj
Create ak
Create al
Create am
Create an
Create ao
Create ap
Create aq
Create ar
Open /many and print the directory
name               inode   offset   reclen  type
a                          17        0    268   0x010c
b                          18      268    268   0x010c
c                          19      536    268   0x010c
d                          20      804    268   0x010c
e                          21     1072    268   0x010c
f                          22     1340    268   0x010c
g                          23     1608    268   0x010c
h                          24     1876    268   0x010c
i                          25     2144    268   0x010c
j                          26     2412    268   0x010c
k                          27     2680    268   0x010c
l                          28     2948    268   0x010c
m                          29     3216    268   0x010c
n                          30     3484    268   0x010c
o                          31     3752    268   0x010c
p                          32     4020    268   0x010c
q                          33     4288    268   0x010c
r                          34     4556    268   0x010c
s                          35     4824    268   0x010c
t                          36     5092    268   0x010c
u                          37     5360    268   0x010c
v                          38     5628    268   0x010c
w                          39     5896    268   0x010c
x                          40     6164    268   0x010c
y                          41     6432    268   0x010c
z                          42     6700    268   0x010c
aa                         43     6968    268   0x010c
ab                         44     7236    268   0x010c
ac                         45     7504    268   0x010c
ad                         46     7772    268   0x010c
ae                         47     8040    268   0x010c
af                         48     8308    268   0x010c
ag                         49     8576    268   0x010c
ah                         50     8844    268   0x010c
ai                         51     9112    268   0x010c
aj                         52     9380    268   0x010c
ak                         53     9648    268   0x010c
al                         54     9916    268   0x010c
am                         55    10184    268   0x010c
an                         56    10452    268   0x010c
ao                         57    10720    268   0x010c
ap                         58    10988    268   0x010c
aq                         59    11256    268   0x010c
ar                         60    11524    268   0x010c
open /b/myfile
scandir a file status: -1
Open /b/new_file
fcntl F_SETFD should return 0
fcntl F_SETFD should return 1
fcntl F_DUPFD should return 0 -- skip until implemented
fcntl F_GETFL returns current flags
fcntl F_GETFL returned 0x200
fcntl F_SETFL to add O_APPEND and O_NONBLOCK
fcntl F_GETFL return current flags to see changes
fcntl F_GETFL returned 0x1208
fcntl F_GETLK should return -1
fcntl F_SETLK should return -1
fcntl F_SETLKW should return -1
fcntl F_SETOWN should return -1
fcntl F_GETOWN should return -1
fcntl invalid argument should return -1
Status -1
opendir and readdir /b/myfile
opendir and readdir
chdir to /b/myfile
Performing stat of directory /
status for stat : 0, size of directory: 2144
Open and print directory /
name               inode   offset   reclen  type
dev                         2        0    268   0x010c
a                           5      268    268   0x010c
b                           6      536    268   0x010c
c                           7      804    268   0x010c
d                           8     1072    268   0x010c
e                           9     1340    268   0x010c
f                          10     1608    268   0x010c
many                       16     1876    268   0x010c
mkdir /d/my_dir
Open /d/my_dir
remove /d/my_dir.
close /d/my_dir.
Opening directory /c
name               inode   offset   reclen  type
y                          11        0    268   0x010c
z                          12      268    268   0x010c
x                          13      536    268   0x010c
Opening directory /c/y
name               inode   offset   reclen  type
a3333                      14        0    268   0x010c
j123                       15      268    268   0x010c
LSEEK to the start of the open directory
name               inode   offset   reclen  type
dev                         2        0    268   0x010c
a                           5      268    268   0x010c
b                           6      536    268   0x010c
c                           7      804    268   0x010c
d                           8     1072    268   0x010c
e                           9     1340    268   0x010c
f                          10     1608    268   0x010c
many                       16     1876    268   0x010c
Rewinding directory
name               inode   offset   reclen  type
dev                         2        0    268   0x010c
a                           5      268    268   0x010c
b                           6      536    268   0x010c
c                           7      804    268   0x010c
d                           8     1072    268   0x010c
e                           9     1340    268   0x010c
f                          10     1608    268   0x010c
many                       16     1876    268   0x010c
Send rewinddir a NULL pointer
Seek directory
telldir() should report only sizeof(struct dirent) increments
in position. Sizeof(struct dirent): 268
seeked to  0 -- currently at  0
seeked to 67 -- currently at  0
seeked to 134 -- currently at  0
Send seekdir a NULL pointer
Closing directory
SCANDIR TEST
selection rule 1
scanning for any entry under directory /c
SCANDIR SELECT1 accepts  nodename: y
SCANDIR SELECT1 accepts  nodename: z
SCANDIR SELECT1 accepts  nodename: x
scandir status: 3
Selected Node Name: y
Selected Node Name: z
Selected Node Name: x
selection rule 2
scanning for any entry under directory /c whose name = y
SCANDIR SELECT accepted nodename: y
SCANDIR SELECT rejected nodename: z
SCANDIR SELECT rejected nodename: x
scandir status: 1
Selected Node Name: y
SCANDIR with sorting
selection rule 1
scanning for any entry under directory /c
sort in ascending order
SCANDIR SELECT1 accepts  nodename: y
SCANDIR SELECT1 accepts  nodename: z
SCANDIR SELECT1 accepts  nodename: x
scandir status: 3
Selected and Sorted Node Name: x
Selected and Sorted Node Name: y
Selected and Sorted Node Name: z
SCANDIR with sorting
selection rule 1
scanning for any entry under directory /c
sort in descending order
SCANDIR SELECT1 accepts  nodename: y
SCANDIR SELECT1 accepts  nodename: z
SCANDIR SELECT1 accepts  nodename: x
scandir status: 3
Selected and Sorted Node Name: z
Selected and Sorted Node Name: y
Selected and Sorted Node Name: x
Validate readdir across mount point
name               inode   offset   reclen  type
should_be_hidden           65        0    268   0x010c
Attempting to mount IMFS file system at /imfs
create /imfs/testdir and /imfs/testdir/testsubdir
name               inode   offset   reclen  type
testdir                     2        0    268   0x010c
name               inode   offset   reclen  type
testdir                     2        0    268   0x010c
name               inode   offset   reclen  type
testdir                     2        0    268   0x010c
name               inode   offset   reclen  type
testsubdir                  3        0    268   0x010c
name               inode   offset   reclen  type
testdir                     2        0    268   0x010c
*** END OF READDIR TEST ***