Skip to content

Commit

Permalink
check spec
Browse files Browse the repository at this point in the history
  • Loading branch information
kazmsk committed Dec 26, 2024
1 parent aa875cc commit 9c60122
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use anyhow::{Context, Ok, Result};
use oci_spec::runtime::{Capability, LinuxCapabilitiesBuilder, ProcessBuilder, Spec, SpecBuilder};
use test_framework::{test_result, Test, TestGroup, TestResult};

use serde_json::Value;

use crate::utils::{test_inside_container, test_utils::CreateOptions};

fn create_spec() -> Result<Spec> {
Expand Down Expand Up @@ -35,10 +33,13 @@ fn process_capabilities_fail_test() -> TestResult {
test_inside_container(spec, &CreateOptions::default(), &|bundle| {
let spec_path = bundle.join("../config.json");
let spec_str = fs::read_to_string(spec_path).unwrap();
let spec: Value = serde_json::from_str(&spec_str)?;
let spec: Spec = serde_json::from_str(&spec_str)?;
if let Some(process) = spec.process() {
println!("Process: {:?}", process);
}
// let capabilities = spec.get("process").and_then(|process| process.get("capabilities")).and_then(|value| value.as_str()).unwrap_or("Unknown");
let process = spec.get("process").and_then(|process| process.as_str()).unwrap_or("Unknown");
println!("process: {}", process);
// let process = spec.get("process").and_then(|process| process.as_str()).unwrap_or("Unknown");
// println!("process: {}", process);
Ok(())
})
}
Expand Down

0 comments on commit 9c60122

Please sign in to comment.