From d9a0d9e28148275330907c414745b5bbda94b957 Mon Sep 17 00:00:00 2001 From: Tomasz Grzegowski Date: Fri, 20 Dec 2024 09:31:41 +0000 Subject: [PATCH] Neptun debug --- .github/workflows/tests.yml | 18 +++++++++++++----- neptun-cli/src/main.rs | 6 +++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4da2aa5..556cf17 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,12 +64,20 @@ jobs: python -m pip install --upgrade pip pip install pipenv pipenv install - - name: Execute xray - working-directory: xray + # - name: Execute xray + # working-directory: xray + # run: | + # pipenv run python run.py --wg native --ascii --save-output + # # pipenv run python run.py --wg wggo --ascii --save-output + # # pipenv run python run.py --wg neptun --ascii --save-output + - name: Build neptun + run: | + cargo build + - name: Execute neptun + working-directory: target/debug run: | - pipenv run python run.py --wg native --ascii --save-output - # pipenv run python run.py --wg wggo --ascii --save-output - # pipenv run python run.py --wg neptun --ascii --save-output + sudo RUST_LOG=info ./neptun-cli nept -l neptun.log --disable-drop-privileges + cat neptun.log - name: Upload graph results uses: actions/upload-artifact@v4 with: diff --git a/neptun-cli/src/main.rs b/neptun-cli/src/main.rs index 66713da..54d79d5 100644 --- a/neptun-cli/src/main.rs +++ b/neptun-cli/src/main.rs @@ -111,6 +111,7 @@ fn main() { .init(); let daemonize = Daemonize::new().working_directory("/tmp"); + dbg!(&daemonize); match daemonize.execute() { Outcome::Parent(Ok(Parent { @@ -118,10 +119,13 @@ fn main() { .. })) => { let mut b = [0u8; 1]; - if sock2.recv(&mut b).is_ok() && b[0] == 1 { + let rx = sock2.recv(&mut b); + if rx.is_ok() && b[0] == 1 { println!("NepTUN started successfully"); exit(first_child_exit_code) } else { + dbg!(&rx); + dbg!(&b); eprintln!("NepTUN failed to start"); exit(1); };