Skip to content

Commit fe2db62

Browse files
authored
refactor: remove old tests files which have been merged (#147)
1 parent c5ab1b3 commit fe2db62

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+78
-5015
lines changed

rust/src/tests/chflags.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ fn get_flags(ctx: &TestContext) -> (FileFlag, FileFlag, FileFlag) {
7979

8080
crate::test_case! {
8181
/// chflags(2) set the flags provided for the file.
82+
// chflags/00.t
8283
set_flags, root, FileSystemFeature::Chflags => [Regular, Dir, Fifo, Block, Char, Socket]
8384
}
8485
fn set_flags(ctx: &mut TestContext, ft: FileType) {
@@ -110,6 +111,7 @@ fn set_flags(ctx: &mut TestContext, ft: FileType) {
110111

111112
crate::test_case! {
112113
/// chflags changes flags while following symlinks
114+
// chflags/00.t
113115
set_flags_symlink, root, FileSystemFeature::Chflags
114116
}
115117
fn set_flags_symlink(ctx: &mut TestContext) {
@@ -133,6 +135,7 @@ fn set_flags_symlink(ctx: &mut TestContext) {
133135
#[cfg(lchflags)]
134136
crate::test_case! {
135137
/// lchflags changes flags without following symlinks
138+
// chflags/00.t
136139
lchflags_set_flags_no_follow_symlink, root, FileSystemFeature::Chflags
137140
}
138141
#[cfg(lchflags)]
@@ -155,7 +158,8 @@ fn lchflags_set_flags_no_follow_symlink(ctx: &mut TestContext) {
155158
}
156159

157160
crate::test_case! {
158-
// successful chflags(2) updates ctime
161+
/// successful chflags(2) updates ctime
162+
// chflags/00.t
159163
changed_ctime_success, root => [Regular, Dir, Fifo, Block, Char, Socket]
160164
}
161165
fn changed_ctime_success(ctx: &mut TestContext, ft: FileType) {
@@ -185,7 +189,8 @@ fn changed_ctime_success(ctx: &mut TestContext, ft: FileType) {
185189
}
186190
}
187191
crate::test_case! {
188-
// unsuccessful chflags(2) does not update ctime
192+
/// unsuccessful chflags(2) does not update ctime
193+
// chflags/00.t
189194
unchanged_ctime_failed, serialized, root => [Regular, Dir, Fifo, Block, Char, Socket]
190195
}
191196
fn unchanged_ctime_failed(ctx: &mut SerializedTestContext, ft: FileType) {
@@ -226,6 +231,8 @@ enotdir_comp_test_case!(chflags(~path, FileFlag::empty()));
226231

227232
// chflags/02.t
228233
enametoolong_comp_test_case!(chflags(~path, FileFlag::empty()));
234+
235+
// chflags/03.t
229236
enametoolong_path_test_case!(chflags(~path, FileFlag::empty()));
230237

231238
// chflags/04.t

rust/src/tests/chmod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ fn failed_chmod_unchanged_ctime(ctx: &mut SerializedTestContext, f_type: FileTyp
8585
});
8686
}
8787

88+
// chmod/00.t:L119
8889
crate::test_case! {
8990
/// S_ISGID bit shall be cleared upon successful return from chmod of a regular file
9091
/// if the calling process does not have appropriate privileges, and if
@@ -149,7 +150,7 @@ crate::test_case! {
149150
/// chmod returns EFTYPE if the effective user ID is not the super-user,
150151
/// the mode includes the sticky bit (S_ISVTX),
151152
/// and path does not refer to a directory
152-
// chmod/12.t
153+
// chmod/11.t
153154
eftype, serialized, root => [Regular, Fifo, Block, Char, Socket]
154155
}
155156
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
@@ -198,7 +199,10 @@ fn eftype(ctx: &mut SerializedTestContext, ft: FileType) {
198199
mod lchmod {
199200
use super::*;
200201

202+
// chmod/01.t
201203
enotdir_comp_test_case!(lchmod(~path, Mode::empty()));
204+
205+
// chmod/04.t
202206
enoent_named_file_test_case!(lchmod(~path, Mode::empty()));
203207
enoent_comp_test_case!(lchmod(~path, Mode::empty()));
204208

rust/src/tests/chown.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ fn chown_wrapper(ctx: &mut TestContext, path: &std::path::Path) -> nix::Result<(
1616
chown(path, Some(user.uid), None)
1717
}
1818

19+
// chown/01.t
1920
enotdir_comp_test_case!(chown, chown_wrapper);
2021

22+
// chown/02.t
23+
enametoolong_comp_test_case!(chown, chown_wrapper);
24+
25+
// chown/03.t
26+
enametoolong_path_test_case!(chown, chown_wrapper);
27+
2128
// chown/04.t
2229
enoent_named_file_test_case!(chown, chown_wrapper);
2330

@@ -33,12 +40,6 @@ eloop_comp_test_case!(chown, chown_wrapper);
3340
// chown/06.t
3441
eloop_final_comp_test_case!(chown, chown_wrapper);
3542

36-
// chown/02.t
37-
enametoolong_comp_test_case!(chown, chown_wrapper);
38-
39-
// chown/03.t
40-
enametoolong_path_test_case!(chown, chown_wrapper);
41-
4243
// chown/09.t
4344
erofs_named_test_case!(chown, chown_wrapper);
4445

@@ -56,14 +57,20 @@ mod lchown {
5657
lchown(path, Some(user.uid), Some(user.gid))
5758
}
5859

60+
// chown/01.t
5961
enotdir_comp_test_case!(lchown, lchown_wrapper);
62+
63+
// chown/04.t
6064
enoent_named_file_test_case!(lchown, lchown_wrapper);
6165
enoent_comp_test_case!(lchown, lchown_wrapper);
6266

6367
// chown/06.t#L25
6468
eloop_comp_test_case!(lchown, lchown_wrapper);
65-
69+
70+
// chown/02.t
6671
enametoolong_comp_test_case!(lchown, lchown_wrapper);
72+
73+
// chown/03.t
6774
enametoolong_path_test_case!(lchown, lchown_wrapper);
6875

6976
// chown/09.t

rust/src/tests/ftruncate.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::{
1717

1818
crate::test_case! {
1919
/// ftruncate should extend a file, and shrink a sparse file
20+
// ftruncate/00.t
2021
extend_file_shrink_sparse
2122
}
2223
fn extend_file_shrink_sparse(ctx: &mut TestContext) {
@@ -37,6 +38,7 @@ fn extend_file_shrink_sparse(ctx: &mut TestContext) {
3738

3839
crate::test_case! {
3940
/// ftruncate should shrink the file if the specified size is less than the actual one
41+
// ftruncate/00.t
4042
shrink_not_empty
4143
}
4244
fn shrink_not_empty(ctx: &mut TestContext) {
@@ -62,6 +64,7 @@ fn shrink_not_empty(ctx: &mut TestContext) {
6264

6365
crate::test_case! {
6466
/// ftruncate should update ctime if it succeeds
67+
// ftruncate/00.t
6568
update_ctime_success
6669
}
6770
fn update_ctime_success(ctx: &mut TestContext) {
@@ -74,6 +77,7 @@ fn update_ctime_success(ctx: &mut TestContext) {
7477

7578
crate::test_case! {
7679
/// ftruncate should not update ctime if it fails
80+
// ftruncate/00.t
7781
unchanged_ctime_failed
7882
}
7983
fn unchanged_ctime_failed(ctx: &mut TestContext) {
@@ -88,6 +92,7 @@ crate::test_case! {
8892
/// The file mode of a newly created file should not affect whether ftruncate
8993
/// will work, only the create args
9094
/// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=154873
95+
// ftruncate/00.t
9196
affected_create_flags_only, serialized, root
9297
}
9398
fn affected_create_flags_only(ctx: &mut SerializedTestContext) {

rust/src/tests/link.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ fn has_reasonable_link_max(_: &Config, base_path: &Path) -> anyhow::Result<()> {
186186

187187
crate::test_case! {
188188
/// link returns EMLINK if the link count of the file named by name1 would exceed {LINK_MAX}
189+
// link/05.t
189190
link_count_max; has_reasonable_link_max
190191
}
191192
fn link_count_max(ctx: &mut TestContext) {
@@ -233,6 +234,7 @@ fn enoent_source_not_exists(ctx: &mut TestContext) {
233234

234235
crate::test_case! {
235236
/// link returns EEXIST if the destination file exists
237+
// link/10.t
236238
eexist_dest_exists => [Regular, Dir, Fifo, Block, Char, Socket, Symlink(None)]
237239
}
238240
fn eexist_dest_exists(ctx: &mut TestContext, ft: FileType) {

rust/src/tests/mkdir.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ crate::test_case! {
1717
/// POSIX: The file permission bits of the new directory shall be initialized from
1818
/// mode. These file permission bits of the mode argument shall be modified by the
1919
/// process' file creation mask.
20+
// mkdir/00.t
2021
permission_bits_from_mode, serialized
2122
}
2223
fn permission_bits_from_mode(ctx: &mut SerializedTestContext) {
@@ -27,6 +28,7 @@ crate::test_case! {
2728
/// POSIX: The directory's user ID shall be set to the process' effective user ID.
2829
/// The directory's group ID shall be set to the group ID of the parent directory
2930
/// or to the effective group ID of the process.
31+
// mkdir/00.t
3032
uid_gid_eq_euid_egid, serialized, root
3133
}
3234
fn uid_gid_eq_euid_egid(ctx: &mut SerializedTestContext) {
@@ -38,6 +40,7 @@ crate::test_case! {
3840
/// st_ctime, and st_mtime fields of the directory. Also, the st_ctime and
3941
/// st_mtime fields of the directory that contains the new entry shall be marked
4042
/// for update.
43+
// mkdir/00.t
4144
changed_time_fields_success
4245
}
4346
fn changed_time_fields_success(ctx: &mut TestContext) {
@@ -51,6 +54,7 @@ fn changed_time_fields_success(ctx: &mut TestContext) {
5154
});
5255
}
5356

57+
// mkdir/01.t
5458
enotdir_comp_test_case!(mkdir(~path, Mode::empty()));
5559

5660
// mkdir/02.t

rust/src/tests/mkfifo.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ crate::test_case! {
1818
/// POSIX: The file permission bits of the new FIFO shall be initialized from
1919
/// mode. The file permission bits of the mode argument shall be modified by the
2020
/// process' file creation mask.
21+
// mkfifo/00.t
2122
permission_bits_from_mode, serialized
2223
}
2324
fn permission_bits_from_mode(ctx: &mut SerializedTestContext) {
@@ -28,6 +29,7 @@ crate::test_case! {
2829
/// POSIX: The FIFO's user ID shall be set to the process' effective user ID.
2930
/// The FIFO's group ID shall be set to the group ID of the parent directory or to
3031
/// the effective group ID of the process.
32+
// mkfifo/00.t
3133
uid_gid_eq_euid_egid, serialized, root
3234
}
3335
fn uid_gid_eq_euid_egid(ctx: &mut SerializedTestContext) {
@@ -39,6 +41,7 @@ crate::test_case! {
3941
/// st_ctime, and st_mtime fields of the file. Also, the st_ctime and
4042
/// st_mtime fields of the directory that contains the new entry shall be marked
4143
/// for update.
44+
// mkfifo/00.t
4245
changed_time_fields_success
4346
}
4447
fn changed_time_fields_success(ctx: &mut TestContext) {

rust/src/tests/mknod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ crate::test_case! {
2222
/// POSIX: The file permission bits of the new FIFO shall be initialized from
2323
/// mode. The file permission bits of the mode argument shall be modified by the
2424
/// process' file creation mask.
25+
// mknod/00.t
2526
permission_bits_from_mode, serialized
2627
}
2728
fn permission_bits_from_mode(ctx: &mut SerializedTestContext) {
@@ -32,6 +33,7 @@ crate::test_case! {
3233
/// POSIX: The FIFO's user ID shall be set to the process' effective user ID.
3334
/// The FIFO's group ID shall be set to the group ID of the parent directory or to
3435
/// the effective group ID of the process.
36+
// mknod/00.t
3537
uid_gid_eq_euid_egid, serialized, root
3638
}
3739
fn uid_gid_eq_euid_egid(ctx: &mut SerializedTestContext) {
@@ -43,6 +45,7 @@ crate::test_case! {
4345
/// st_ctime, and st_mtime fields of the file. Also, the st_ctime and
4446
/// st_mtime fields of the directory that contains the new entry shall be marked
4547
/// for update.
48+
// mknod/00.t
4649
changed_time_fields_success
4750
}
4851
fn changed_time_fields_success(ctx: &mut TestContext) {
@@ -59,16 +62,17 @@ fn changed_time_fields_success(ctx: &mut TestContext) {
5962
// mknod/01.t
6063
enotdir_comp_test_case!(mknod(~path, SFlag::S_IFIFO, Mode::empty(), 0));
6164

65+
// TODO: Move to privileged module
6266
crate::test_case! {
6367
/// mknod returns ENOTDIR if a component of the path prefix is not a directory
6468
/// when trying to create char/block files
69+
// mknod/01.t
6570
enotdir_comp_char_block, root => [Regular, Fifo, Block, Char, Socket]
6671
}
6772
fn enotdir_comp_char_block(ctx: &mut TestContext, ft: FileType) {
6873
let base_path = ctx.create(ft).unwrap();
6974
let path = base_path.join("previous_not_dir");
7075

71-
// mknod/01.t
7276
assert_eq!(
7377
mknod(&path, SFlag::S_IFCHR, Mode::empty(), 0).unwrap_err(),
7478
Errno::ENOTDIR
@@ -125,10 +129,12 @@ fn device_files(ctx: &mut TestContext, ft: FileType) {
125129
assert!(check(&stat.file_type()));
126130
}
127131

132+
// TODO: Move to privileged module and precise that it concerns only block and char
128133
crate::test_case! {
129134
/// mknod changes st_ctime and st_mtime of the parent directory
130135
/// and marks for update the st_atime, st_ctime and st_mtime fields
131136
/// of the new file
137+
// mknod/00.t
132138
changed_times_success, root => [Block, Char]
133139
}
134140
fn changed_times_success(ctx: &mut TestContext, ft: FileType) {
@@ -157,7 +163,8 @@ fn changed_times_success(ctx: &mut TestContext, ft: FileType) {
157163

158164
#[cfg(target_os = "illumos")]
159165
crate::test_case! {
160-
/// mknod creates devices with old and new numbers
166+
/// mknod creates devices with old and new-style numbers
167+
// mknod/11.t
161168
create_old_new_device, root
162169
}
163170
#[cfg(target_os = "illumos")]

0 commit comments

Comments
 (0)