Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/firecracker
Path: blob/main/tests/integration_tests/security/test_sec_audit.py
1958 views
1
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
# SPDX-License-Identifier: Apache-2.0
3
"""Tests ensuring security vulnerabilities are not present in dependencies."""
4
5
6
import os
7
import platform
8
import pytest
9
10
import framework.utils as utils
11
12
13
@pytest.mark.skipif(
14
platform.machine() != "x86_64",
15
reason="The audit is based on cargo.lock which "
16
"is identical on all platforms"
17
)
18
def test_cargo_audit():
19
"""Fail if there are crates with security vulnerabilities."""
20
cargo_lock_path = os.path.normpath(
21
os.path.join(
22
os.path.dirname(os.path.realpath(__file__)),
23
'../../../Cargo.lock')
24
)
25
26
# Run command and raise exception if non-zero return code
27
utils.run_cmd('cargo audit -q -f {}'.format(cargo_lock_path))
28
29