Skip to content

Commit

Permalink
upgrade tests, remove deps to Xcode 12
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Dec 17, 2022
1 parent 6c32278 commit 49fd1cf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ jobs:
default: true
override: true

# https://github.com/actions/virtual-environments/issues/2557#issuecomment-769611326
- if: ${{ matrix.target }} == 'aarch64-apple-darwin'
run: |
sudo xcode-select -s /Applications/Xcode_12.4.app &&
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
- name: Build release
shell: bash
run: |
Expand Down
4 changes: 2 additions & 2 deletions tests/socks4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ async fn socks4_relay_connect() {
let svr = Socks4TestServer::new(SERVER_ADDR, LOCAL_ADDR, PASSWORD, METHOD);
svr.run().await;

static HTTP_REQUEST: &[u8] = b"GET / HTTP/1.0\r\nHost: www.example.com\r\nAccept: */*\r\n\r\n";
static HTTP_REQUEST: &[u8] = b"GET /success.txt HTTP/1.0\r\nHost: detectportal.firefox.com\r\nAccept: */*\r\n\r\n";

let mut c = Socks4TcpClient::connect(("www.example.com", 80), LOCAL_ADDR, Vec::new())
let mut c = Socks4TcpClient::connect(("detectportal.firefox.com", 80), LOCAL_ADDR, Vec::new())
.await
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions tests/socks5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ async fn socks5_relay_aead() {
svr.run().await;

let mut c = Socks5TcpClient::connect(
Address::DomainNameAddress("www.example.com".to_owned(), 80),
Address::DomainNameAddress("detectportal.firefox.com".to_owned(), 80),
svr.client_addr(),
)
.await
.unwrap();

let req = b"GET / HTTP/1.0\r\nHost: www.example.com\r\nAccept: */*\r\n\r\n";
let req = b"GET /success.txt HTTP/1.0\r\nHost: detectportal.firefox.com\r\nAccept: */*\r\n\r\n";
c.write_all(req).await.unwrap();
c.flush().await.unwrap();

Expand Down
9 changes: 4 additions & 5 deletions tests/tunnel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use tokio::{

use shadowsocks_service::{
config::{Config, ConfigType},
run_local,
run_server,
run_local, run_server,
};

#[tokio::test]
Expand All @@ -26,7 +25,7 @@ async fn tcp_tunnel() {
"local_port": 9110,
"local_address": "127.0.0.1",
"protocol": "tunnel",
"forward_address": "www.example.com",
"forward_address": "detectportal.firefox.com",
"forward_port": 80
}
],
Expand Down Expand Up @@ -55,10 +54,10 @@ async fn tcp_tunnel() {

time::sleep(Duration::from_secs(1)).await;

// Connect it directly, because it is now established a TCP tunnel with www.example.com
// Connect it directly, because it is now established a TCP tunnel with detectportal.firefox.com
let mut stream = TcpStream::connect("127.0.0.1:9110").await.unwrap();

let req = b"GET / HTTP/1.0\r\nHost: www.example.com\r\nAccept: */*\r\n\r\n";
let req = b"GET /success.txt HTTP/1.0\r\nHost: detectportal.firefox.com\r\nAccept: */*\r\n\r\n";
stream.write_all(req).await.unwrap();
stream.flush().await.unwrap();

Expand Down

0 comments on commit 49fd1cf

Please sign in to comment.