| 2116 | |
| 2117 | #[tokio::test] |
| 2118 | async fn p2_cli_serve_config() -> Result<()> { |
| 2119 | let server = WasmtimeServe::new(P2_CLI_SERVE_CONFIG_COMPONENT, |cmd| { |
| 2120 | cmd.arg("-Scli"); |
| 2121 | cmd.arg("-Sconfig"); |
| 2122 | cmd.arg("-Sconfig-var=hello=world"); |
| 2123 | })?; |
| 2124 | |
| 2125 | let resp = server |
| 2126 | .send_request( |
| 2127 | hyper::Request::builder() |
| 2128 | .uri("http://localhost/") |
| 2129 | .body(String::new()) |
| 2130 | .context("failed to make request")?, |
| 2131 | ) |
| 2132 | .await?; |
| 2133 | |
| 2134 | assert!(resp.status().is_success()); |
| 2135 | assert_eq!(resp.body(), "world"); |
| 2136 | Ok(()) |
| 2137 | } |
| 2138 | |
| 2139 | #[test] |
| 2140 | fn p2_cli_config() -> Result<()> { |