@@ -41,23 +41,6 @@ fn skip_if_missing() -> Option<PathBuf> {
4141 }
4242}
4343
44- /// Returns the fixture path only when the http-client component has been
45- /// migrated to declare `allow = [{ host = "*" }]` in its `[std.capabilities."wasi:http"]`
46- /// section (Task 6). Without this, the new hard-deny enforcement will reject
47- /// ALL HTTP calls from this component, causing every request-exercising test
48- /// to fail. Set `ACT_TEST_HTTP_CLIENT_MIGRATED=1` after completing Task 6.
49- fn skip_if_not_migrated ( ) -> Option < PathBuf > {
50- if std:: env:: var ( "ACT_TEST_HTTP_CLIENT_MIGRATED" ) . is_ok ( ) {
51- skip_if_missing ( )
52- } else {
53- eprintln ! (
54- "skipping: set ACT_TEST_HTTP_CLIENT_MIGRATED=1 after running Task 6 \
55- (http-client component needs allow entries in its wasi:http capability declaration)"
56- ) ;
57- None
58- }
59- }
60-
6144fn run_call ( args : & [ & str ] ) -> ( bool , String , String ) {
6245 let output = Command :: new ( env ! ( "CARGO_BIN_EXE_act" ) )
6346 . args ( args)
@@ -72,7 +55,7 @@ fn run_call(args: &[&str]) -> (bool, String, String) {
7255
7356#[ test]
7457fn default_deny_blocks_http ( ) {
75- let Some ( wasm) = skip_if_not_migrated ( ) else {
58+ let Some ( wasm) = skip_if_missing ( ) else {
7659 return ;
7760 } ;
7861 let wasm_s = wasm. to_string_lossy ( ) . to_string ( ) ;
@@ -92,7 +75,7 @@ fn default_deny_blocks_http() {
9275
9376#[ test]
9477fn http_allow_matching_host_succeeds ( ) {
95- let Some ( wasm) = skip_if_not_migrated ( ) else {
78+ let Some ( wasm) = skip_if_missing ( ) else {
9679 return ;
9780 } ;
9881 let wasm_s = wasm. to_string_lossy ( ) . to_string ( ) ;
@@ -117,7 +100,7 @@ fn http_allow_matching_host_succeeds() {
117100
118101#[ test]
119102fn http_allow_mismatched_host_blocks ( ) {
120- let Some ( wasm) = skip_if_not_migrated ( ) else {
103+ let Some ( wasm) = skip_if_missing ( ) else {
121104 return ;
122105 } ;
123106 let wasm_s = wasm. to_string_lossy ( ) . to_string ( ) ;
@@ -142,7 +125,7 @@ fn http_allow_mismatched_host_blocks() {
142125
143126#[ test]
144127fn http_policy_open_allows_any_host ( ) {
145- let Some ( wasm) = skip_if_not_migrated ( ) else {
128+ let Some ( wasm) = skip_if_missing ( ) else {
146129 return ;
147130 } ;
148131 let wasm_s = wasm. to_string_lossy ( ) . to_string ( ) ;
@@ -173,7 +156,7 @@ fn deny_cidr_blocks_with_dns_error() {
173156 // resolver filters all addresses out and the guest sees DnsError
174157 // (not ConnectionRefused — we walk reqwest's error chain to
175158 // surface policy denials as DNS errors).
176- let Some ( wasm) = skip_if_not_migrated ( ) else {
159+ let Some ( wasm) = skip_if_missing ( ) else {
177160 return ;
178161 } ;
179162 let wasm_s = wasm. to_string_lossy ( ) . to_string ( ) ;
@@ -206,7 +189,7 @@ fn allow_cidr_only_blocks_when_no_host_match() {
206189 // runs. This is correct under the declaration-as-ceiling model:
207190 // components declare peers by name, and user-policy CIDR-only rules
208191 // have no declared host to pair with.
209- let Some ( wasm) = skip_if_not_migrated ( ) else {
192+ let Some ( wasm) = skip_if_missing ( ) else {
210193 return ;
211194 } ;
212195 let wasm_s = wasm. to_string_lossy ( ) . to_string ( ) ;
@@ -230,7 +213,7 @@ fn allow_cidr_only_blocks_when_no_host_match() {
230213fn allow_cidr_with_host_match_succeeds ( ) {
231214 // Host-anchored allow rule approves the hostname → resolver keeps
232215 // every resolved IP regardless of the unrelated allow-CIDR rule.
233- let Some ( wasm) = skip_if_not_migrated ( ) else {
216+ let Some ( wasm) = skip_if_missing ( ) else {
234217 return ;
235218 } ;
236219 let wasm_s = wasm. to_string_lossy ( ) . to_string ( ) ;
0 commit comments