Skip to content

aarch64: enable coverage integration test #2090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/vmm/src/signal_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ mod tests {
assert!(METRICS.signals.sigxcpu.count() >= 1);
assert!(METRICS.signals.sigpipe.count() >= 1);
assert!(METRICS.signals.sighup.count() >= 1);
// Workaround to GitHub issue 2216.
#[cfg(not(target_arch = "aarch64"))]
assert!(METRICS.signals.sigill.count() >= 1);
}
}
5 changes: 5 additions & 0 deletions tests/host_tools/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ def proc_type():
for line in lines:
if "model name" in line:
return re.sub(".*model name.*:", "", line, 1)

cmd = "uname -m"
result = utils.run_cmd(cmd).stdout.strip()
if "aarch64" in result:
return "ARM"
return ""
13 changes: 6 additions & 7 deletions tests/integration_tests/build/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# this contains the frequency while on AMD it does not.
# Checkout the cpuid crate. In the future other
# differences may appear.
COVERAGE_DICT = {"Intel": 85.20, "AMD": 84.36}
COVERAGE_DICT = {"Intel": 85.20, "AMD": 84.36, "ARM": 82.70}
PROC_MODEL = proc.proc_type()

COVERAGE_MAX_DELTA = 0.05
Expand Down Expand Up @@ -78,10 +78,6 @@ def test_ensure_mod_tests():


@pytest.mark.timeout(400)
@pytest.mark.skipif(
platform.machine() != "x86_64",
reason="kcov hangs on aarch64"
)
def test_coverage(test_session_root_path, test_session_tmp_path):
"""Test line coverage with kcov.

Expand All @@ -106,14 +102,17 @@ def test_coverage(test_session_root_path, test_session_tmp_path):
'_gen'
)
exclude_region = '\'mod tests {\''
target = "{}-unknown-linux-musl".format(platform.machine())

cmd = (
'CARGO_TARGET_DIR={} cargo kcov --all '
'--output {} -- '
'RUSTFLAGS="{}" CARGO_TARGET_DIR={} cargo kcov --all '
'--target {} --output {} -- '
'--exclude-pattern={} '
'--exclude-region={} --verify'
).format(
host.get_rustflags(),
os.path.join(test_session_root_path, CARGO_KCOV_REL_PATH),
target,
test_session_tmp_path,
exclude_pattern,
exclude_region
Expand Down
13 changes: 10 additions & 3 deletions tools/devctr/Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN apt-get update \
iperf3 \
iproute2 \
jq \
libbfd-dev \
libcurl4-openssl-dev \
libdw-dev \
libfdt-dev \
Expand Down Expand Up @@ -71,13 +72,19 @@ RUN apt-get update \

# Install the Rust toolchain
#
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" \
RUN mkdir "$TMP_BUILD_DIR" \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" \
&& rustup target add aarch64-unknown-linux-musl \
&& cd "$TMP_BUILD_DIR" \
&& cargo install cargo-kcov \
&& cargo kcov --print-install-kcov-sh | sh \
&& rm -rf "$CARGO_HOME/registry" \
&& ln -s "$CARGO_REGISTRY_DIR" "$CARGO_HOME/registry" \
&& rm -rf "$CARGO_HOME/git" \
&& ln -s "$CARGO_GIT_REGISTRY_DIR" "$CARGO_HOME/git"
#
&& ln -s "$CARGO_GIT_REGISTRY_DIR" "$CARGO_HOME/git" \
&& cd / \
&& rm -rf "$TMP_BUILD_DIR"

# Add the tini init binary.
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION_TAG}/tini-static-arm64 /sbin/tini
RUN chmod +x /sbin/tini
Expand Down
2 changes: 1 addition & 1 deletion tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
# Development container image (name:tag)
# This should be updated whenever we upgrade the development container.
# (Yet another step on our way to reproducible builds.)
DEVCTR_IMAGE="fcuvm/dev:v20"
DEVCTR_IMAGE="fcuvm/dev:v21"

# Naming things is hard
MY_NAME="Firecracker $(basename "$0")"
Expand Down