Skip to content

Commit 3df7a2a

Browse files
committed
Fix the s390x and sparc64 targets
The problem was that test-runner-linux didn't actually check the test program's exit status, it just looked for a string printed by the ctest crate. Since the cmsg test doesn't use ctest, it didn't print that string. The "panic: attempted to kill init" messages were red herring; that happens even on a successful test. The SIGILL I reported only happened because I tried running the sparc64 tests using user-mode emulation, which CI does not do.
1 parent 5b250ca commit 3df7a2a

File tree

7 files changed

+20
-30
lines changed

7 files changed

+20
-30
lines changed

ci/docker/x86_64-rumprun-netbsd/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ fn find_ok(input: &mut Read, tx: mpsc::Sender<()>) {
4747
for line in BufReader::new(input).lines() {
4848
let line = line.unwrap();
4949
println!("{}", line);
50-
if line.starts_with("PASSED ") && line.contains(" tests") {
50+
if (line.starts_with("PASSED ") && line.contains(" tests")) ||
51+
line.starts_with("test result: ok "){
5152
tx.send(()).unwrap();
5253
}
5354
}

ci/ios/deploy_and_run_on_ios_simulator.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,11 @@ fn run_app_on_simulator() {
129129

130130
let stdout = String::from_utf8_lossy(&output.stdout);
131131
let passed = stdout.lines()
132-
.find(|l| l.contains("PASSED"))
133-
.map(|l| l.contains("tests"))
132+
.find(|l|
133+
(l.contains("PASSED") &&
134+
l.contains("tests")) ||
135+
l.contains("test result: ok")
136+
)
134137
.unwrap_or(false);
135138

136139
println!("Shutting down simulator");

ci/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if [ "$QEMU" != "" ]; then
7777
-net user \
7878
-nographic \
7979
-vga none 2>&1 | tee "${CARGO_TARGET_DIR}/out.log"
80-
exec grep "^PASSED .* tests" "${CARGO_TARGET_DIR}/out.log"
80+
exec egrep "^(PASSED)|(test result: ok)" "${CARGO_TARGET_DIR}/out.log"
8181
fi
8282

8383
# FIXME: x86_64-unknown-linux-gnux32 fail to compile without --release

ci/runtest-android.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ fn main() {
3434
String::from_utf8_lossy(&output.stderr));
3535

3636
let stdout = String::from_utf8_lossy(&output.stdout);
37-
let mut lines = stdout.lines().filter(|l| l.starts_with("PASSED "));
38-
if !lines.any(|l| l.contains(" tests")) {
37+
let passed = stdout.lines().find(|l|
38+
(l.starts_with("PASSED ") && l.contains(" tests")) ||
39+
l.starts_with("test result: ok ")
40+
).unwrap_or_else(|| {
3941
panic!("failed to find successful test run");
40-
}
42+
});
4143
}

ci/test-runner-linux

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ arch=$1
66
prog=$2
77

88
cd /qemu/init
9+
echo "#!/bin/sh\n/prog --color=never" > run_prog.sh
10+
chmod +x run_prog.sh
911
cp -f $2 prog
1012
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
1113
cd ..
@@ -15,9 +17,9 @@ timeout 30s qemu-system-$arch \
1517
-nographic \
1618
-kernel kernel \
1719
-initrd initrd.gz \
18-
-append init=/prog > output || true
20+
-append init=/run_prog.sh > output || true
1921

2022
# remove kernel messages
2123
tr -d '\r' < output | egrep -v '^\['
2224

23-
grep PASSED output > /dev/null
25+
egrep "(PASSED)|(test result: ok)" output > /dev/null

libc-test/build.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,9 @@ extern crate ctest;
66
use std::env;
77

88
fn do_cc() {
9-
// Run the cmsg tests on all Unixen, but skip them on platforms that fail
10-
// due to suspected QEMU bugs. Sparc64 gets SIGILL and s390x hangs, both
11-
// before executing any test functions.
12-
#[cfg(all(unix,
13-
not(target_arch = "sparc64"),
14-
not(target_arch = "s390x")))]
15-
{
16-
cc::Build::new()
17-
.file("src/cmsg.c")
18-
.compile("cmsg");
19-
}
9+
cc::Build::new()
10+
.file("src/cmsg.c")
11+
.compile("cmsg");
2012
}
2113

2214
fn do_ctest() {

libc-test/test/cmsg.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
44
extern crate libc;
55

6-
// Run these tests on all Unixen, but skip them on platforms that fail due to
7-
// suspected QEMU bugs. Sparc64 gets SIGILL and s390x hangs, both before
8-
// executing any test functions.
9-
#[cfg(all(unix,
10-
not(target_arch = "sparc64"),
11-
not(target_arch = "s390x")))]
12-
mod cmsg {
13-
146
use libc::{c_uchar, c_uint, c_void, cmsghdr, msghdr};
157
use std::{mem, ptr};
168

@@ -95,5 +87,3 @@ fn test_cmsg_space() {
9587
}
9688
}
9789
}
98-
99-
}

0 commit comments

Comments
 (0)