Skip to content

Commit

Permalink
Neptun debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-grz committed Dec 20, 2024
1 parent 6592759 commit d201834
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,21 @@ 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 --disable-drop-privileges
# 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:
Expand Down
6 changes: 5 additions & 1 deletion neptun-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,21 @@ fn main() {
.init();

let daemonize = Daemonize::new().working_directory("/tmp");
dbg!(&daemonize);

match daemonize.execute() {
Outcome::Parent(Ok(Parent {
first_child_exit_code,
..
})) => {
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);
};
Expand Down

0 comments on commit d201834

Please sign in to comment.