Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1712fe6

Browse files
committed
silent some tests for openbsd for now
1 parent 6587792 commit 1712fe6

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

tests/by-util/test_cp.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static TEST_NONEXISTENT_FILE: &str = "nonexistent_file.txt";
6969
use uutests::util::compare_xattrs;
7070

7171
/// Assert that mode, ownership, and permissions of two metadata objects match.
72-
#[cfg(all(not(windows), not(target_os = "freebsd")))]
72+
#[cfg(all(not(windows), not(target_os = "freebsd"), not(target_os = "openbsd")))]
7373
macro_rules! assert_metadata_eq {
7474
($m1:expr, $m2:expr) => {{
7575
assert_eq!($m1.mode(), $m2.mode(), "mode is different");
@@ -1553,7 +1553,7 @@ fn test_cp_parents_with_permissions_copy_file() {
15531553
.arg(dir)
15541554
.succeeds();
15551555

1556-
#[cfg(all(unix, not(target_os = "freebsd")))]
1556+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
15571557
{
15581558
let p1_metadata = at.metadata("p1");
15591559
let p2_metadata = at.metadata("p1/p2");
@@ -1596,7 +1596,7 @@ fn test_cp_parents_with_permissions_copy_dir() {
15961596
.arg(dir1)
15971597
.succeeds();
15981598

1599-
#[cfg(all(unix, not(target_os = "freebsd")))]
1599+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
16001600
{
16011601
let p1_metadata = at.metadata("p1");
16021602
let p2_metadata = at.metadata("p1/p2");
@@ -1641,7 +1641,7 @@ fn test_cp_preserve_no_args() {
16411641
.arg("--preserve")
16421642
.succeeds();
16431643

1644-
#[cfg(all(unix, not(target_os = "freebsd")))]
1644+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
16451645
{
16461646
// Assert that the mode, ownership, and timestamps are preserved
16471647
// NOTICE: the ownership is not modified on the src file, because that requires root permissions
@@ -1669,7 +1669,7 @@ fn test_cp_preserve_no_args_before_opts() {
16691669
.arg(dst_file)
16701670
.succeeds();
16711671

1672-
#[cfg(all(unix, not(target_os = "freebsd")))]
1672+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
16731673
{
16741674
// Assert that the mode, ownership, and timestamps are preserved
16751675
// NOTICE: the ownership is not modified on the src file, because that requires root permissions
@@ -1695,7 +1695,7 @@ fn test_cp_preserve_all() {
16951695
// Copy
16961696
ucmd.arg(src_file).arg(dst_file).arg(argument).succeeds();
16971697

1698-
#[cfg(all(unix, not(target_os = "freebsd")))]
1698+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
16991699
{
17001700
// Assert that the mode, ownership, and timestamps are preserved
17011701
// NOTICE: the ownership is not modified on the src file, because that requires root permissions
@@ -3028,7 +3028,7 @@ fn test_copy_through_dangling_symlink_no_dereference_permissions() {
30283028
assert!(at.symlink_exists("d2"), "symlink wasn't created");
30293029

30303030
// `-p` means `--preserve=mode,ownership,timestamps`
3031-
#[cfg(all(unix, not(target_os = "freebsd")))]
3031+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
30323032
{
30333033
let metadata1 = at.symlink_metadata("dangle");
30343034
let metadata2 = at.symlink_metadata("d2");
@@ -3749,7 +3749,7 @@ fn test_preserve_hardlink_attributes_in_directory() {
37493749
//
37503750
// A hard link should have the same inode as the target file.
37513751
at.file_exists("dest/src/link");
3752-
#[cfg(all(unix, not(target_os = "freebsd")))]
3752+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
37533753
assert_eq!(
37543754
at.metadata("dest/src/f").ino(),
37553755
at.metadata("dest/src/link").ino()
@@ -3765,7 +3765,7 @@ fn test_hard_link_file() {
37653765
ucmd.args(&["-f", "--link", "src", "dest"])
37663766
.succeeds()
37673767
.no_output();
3768-
#[cfg(all(unix, not(target_os = "freebsd")))]
3768+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
37693769
assert_eq!(at.metadata("src").ino(), at.metadata("dest").ino());
37703770
}
37713771

@@ -4069,7 +4069,7 @@ fn test_cp_dest_no_permissions() {
40694069
}
40704070

40714071
#[test]
4072-
#[cfg(all(unix, not(target_os = "freebsd")))]
4072+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
40734073
fn test_cp_attributes_only() {
40744074
let (at, mut ucmd) = at_and_ucmd!();
40754075
let a = "file_a";
@@ -6537,7 +6537,7 @@ fn test_cp_preserve_selinux() {
65376537
selinux_perm_dest
65386538
);
65396539

6540-
#[cfg(all(unix, not(target_os = "freebsd")))]
6540+
#[cfg(all(unix, not(target_os = "freebsd"), not(target_os = "openbsd")))]
65416541
{
65426542
// Assert that the mode, ownership, and timestamps are preserved
65436543
// NOTICE: the ownership is not modified on the src file, because that requires root permissions
@@ -6949,7 +6949,7 @@ fn test_cp_current_directory_verbose() {
69496949
// Test copying current directory (.) with preserve attributes.
69506950
// This ensures attributes are preserved when copying the current directory.
69516951
#[test]
6952-
#[cfg(all(not(windows), not(target_os = "freebsd")))]
6952+
#[cfg(all(not(windows), not(target_os = "freebsd"), not(target_os = "openbsd")))]
69536953
fn test_cp_current_directory_preserve_attributes() {
69546954
use filetime::FileTime;
69556955
use std::os::unix::prelude::MetadataExt;

tests/by-util/test_df.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ fn test_type_option() {
326326
}
327327

328328
#[test]
329-
#[cfg(not(any(target_os = "freebsd", target_os = "windows")))] // FIXME: fix test for FreeBSD & Win
329+
#[cfg(not(any(target_os = "freebsd", target_os = "windows", target_os = "openbsd")))] // FIXME: fix test for FreeBSD, OpenBSD & Win
330330
#[cfg(not(feature = "feat_selinux"))]
331331
fn test_type_option_with_file() {
332332
let fs_type = new_ucmd!()

tests/by-util/test_hostname.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ fn test_hostname() {
1414
assert!(ls_default_res.stdout().len() >= ls_domain_res.stdout().len());
1515
}
1616

17-
// FixME: fails for "MacOS" => "failed to lookup address information"
18-
#[cfg(not(target_os = "macos"))]
17+
// FixME: fails for "MacOS" and "OpenBSD" => "failed to lookup address information"
18+
#[cfg(not(any(target_os = "macos", target_os = "openbsd")))]
1919
#[test]
2020
fn test_hostname_ip() {
2121
let result = new_ucmd!().arg("-i").succeeds();

0 commit comments

Comments
 (0)