Skip to content

Commit f6e432e

Browse files
committed
bak
1 parent c7bdf2e commit f6e432e

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

server/src/file_cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl FileCache {
233233
.cloned();
234234
if let Some(v) = index_opt {
235235
result.insert(format!("{key_prefix}/"), v.clone());
236-
// result.insert(key_prefix.to_string(), v); //GitHub Action CI would trigger This, but I could not trigger this in my compute
236+
result.insert(key_prefix.to_string(), v); //GitHub Action CI would trigger This, but I could not trigger this in my compute
237237
}
238238
}
239239
None => {

tests/tests/acme_test.rs

+30-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ async fn simple_acme_test() {
2323
let domain = &domain;
2424
let request_prefix = format!("https://{LOCAL_HOST}:8443/27");
2525
let request_prefix = &request_prefix;
26-
//let https_request_prefix = format!("https://{LOCAL_HOST}:8080/27");
27-
//let https_request_prefix = format!("https://{LOCAL_HOST}:8080/27");
2826
clean_web_domain_dir(domain);
2927
clean_cert();
3028
let server = run_server_with_config("server_config_acme.conf");
@@ -42,8 +40,9 @@ async fn simple_acme_test() {
4240
}
4341
wait_count +=1;
4442
}
45-
43+
4644
assert_files(domain, request_prefix, 1, vec!["", "index.html"]).await;
45+
assert_files(domain, &format!("http://{LOCAL_HOST}:8443/27"), 1, vec!["", "index.html"]).await;
4746
/*
4847
wait_count = 0;
4948
server.abort();
@@ -63,3 +62,31 @@ async fn simple_acme_test() {
6362
assert_files(domain, request_prefix, 1, vec!["", "index.html"]).await;
6463
*/
6564
}
65+
66+
67+
#[tokio::test]
68+
async fn simple_acme_test2() {
69+
let domain = LOCAL_HOST.to_owned();
70+
let domain = &domain;
71+
let request_prefix = format!("https://{LOCAL_HOST}:8443");
72+
let request_prefix = &request_prefix;
73+
clean_web_domain_dir(domain);
74+
clean_cert();
75+
let server = run_server_with_config("server_config_acme.conf");
76+
sleep(Duration::from_secs(2)).await;
77+
upload_file_and_check(domain, request_prefix, 1, vec![]).await;
78+
79+
let (api, _) = get_client_api("client_config.conf");
80+
let mut wait_count =0;
81+
loop {
82+
assert!(wait_count < 30, "30 seconds doest not have cert");
83+
sleep(Duration::from_secs(1)).await;
84+
let cert_info = api.get_acme_cert_info(Some(get_host_path_from_domain(domain).0.to_string())).await.unwrap();
85+
if !cert_info.is_empty() {
86+
break
87+
}
88+
wait_count +=1;
89+
}
90+
91+
assert_files(domain, request_prefix, 1, vec!["", "index.html"]).await;
92+
}

0 commit comments

Comments
 (0)