Skip to content

Commit

Permalink
test also smol-rs/polling support
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Mar 13, 2024
1 parent 27556ba commit fb6e8b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ jobs:
if: ${{ matrix.arch != 'riscv64' }}
- run: cargo xtask ci qemu --arch ${{ matrix.arch }} --profile ${{ matrix.profile }} ${{ matrix.flags }} --package miotcp --features dhcpv4 --netdev rtl8139 --features rtl8139
if: ${{ matrix.arch == 'x86_64' }}
- run: cargo xtask ci qemu --arch ${{ matrix.arch }} --profile ${{ matrix.profile }} ${{ matrix.flags }} --package poll --features dhcpv4 --netdev virtio-net-pci
if: ${{ matrix.arch != 'riscv64' }}
- run: cargo xtask ci qemu --arch ${{ matrix.arch }} --profile ${{ matrix.profile }} ${{ matrix.flags }} --package poll --features dhcpv4 --netdev rtl8139 --features rtl8139
if: ${{ matrix.arch == 'x86_64' }}
- run: cargo xtask ci qemu --arch ${{ matrix.arch }} --profile ${{ matrix.profile }} ${{ matrix.flags }} --package mioudp --features udp,dhcpv4 --netdev virtio-net-pci
if: ${{ matrix.arch != 'riscv64' }}
- run: cargo xtask ci qemu --arch ${{ matrix.arch }} --profile ${{ matrix.profile }} ${{ matrix.flags }} --package mioudp --features udp,dhcpv4 --netdev rtl8139 --features rtl8139
Expand Down
15 changes: 15 additions & 0 deletions xtask/src/ci/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ impl Qemu {
"testudp" => test_testudp()?,
"miotcp" => test_miotcp()?,
"mioudp" => test_mioudp()?,
"poll" => test_poll()?,
_ => {}
}

Expand Down Expand Up @@ -301,6 +302,20 @@ fn test_miotcp() -> Result<()> {
Ok(())
}

fn test_poll() -> Result<()> {
thread::sleep(Duration::from_secs(10));
let buf = "exit";
eprintln!("[CI] send {buf:?} via TCP to 127.0.0.1:9975");
let mut stream = TcpStream::connect("127.0.0.1:9975")?;
stream.write_all(buf.as_bytes())?;

let mut buf = vec![];
let received = stream.read_to_end(&mut buf)?;
eprintln!("[CI] receive: {}", from_utf8(&buf[..received])?);

Ok(())
}

fn test_mioudp() -> Result<()> {
thread::sleep(Duration::from_secs(10));
let buf = "exit";
Expand Down

0 comments on commit fb6e8b8

Please sign in to comment.