asterinas/services/libs/comp-sys/cargo-component/tests/violate_policy.rs

14 lines
440 B
Rust
Raw Normal View History

2023-02-07 08:05:21 +00:00
//! This test checks that if controlled resource not in whitelist is visited, cargo-component will report warning message.
#![feature(once_cell)]
mod test_utils;
#[test]
fn violate_policy() {
2023-03-08 07:42:21 +00:00
let stderr = run_cargo_component_cmd!();
2023-02-07 08:05:21 +00:00
assert!(stderr.contains("access controlled entry point is disallowed"));
assert!(stderr.contains("access foo::foo_add in bar"));
assert!(stderr.contains("access foo::FOO_ITEM in bar"));
}