Path: blob/main/tests/integration_tests/security/test_sec_audit.py
1958 views
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.1# SPDX-License-Identifier: Apache-2.02"""Tests ensuring security vulnerabilities are not present in dependencies."""345import os6import platform7import pytest89import framework.utils as utils101112@pytest.mark.skipif(13platform.machine() != "x86_64",14reason="The audit is based on cargo.lock which "15"is identical on all platforms"16)17def test_cargo_audit():18"""Fail if there are crates with security vulnerabilities."""19cargo_lock_path = os.path.normpath(20os.path.join(21os.path.dirname(os.path.realpath(__file__)),22'../../../Cargo.lock')23)2425# Run command and raise exception if non-zero return code26utils.run_cmd('cargo audit -q -f {}'.format(cargo_lock_path))272829