DTN controller and policy language for satellite networks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

borealis: Add two-node cram test

+52
+3
test/cram/dune
··· 1 + (cram 2 + (deps 3 + (package borealis)))
+49
test/cram/two-nodes.t
··· 1 + Two-node bundle exchange test 2 + ============================== 3 + 4 + Setup config files for two nodes (using unique ports): 5 + 6 + $ PORT1=$((20000 + $$)) 7 + $ PORT2=$((20001 + $$)) 8 + 9 + $ cat > node1.yaml << EOF 10 + > node_id: 1 11 + > port: $PORT1 12 + > peers: 13 + > - node_id: 2 14 + > host: "127.0.0.1" 15 + > port: $PORT2 16 + > contacts: [] 17 + > EOF 18 + 19 + $ cat > node2.yaml << EOF 20 + > node_id: 2 21 + > port: $PORT2 22 + > peers: 23 + > - node_id: 1 24 + > host: "127.0.0.1" 25 + > port: $PORT1 26 + > contacts: [] 27 + > EOF 28 + 29 + Start node 2 (server) in background: 30 + 31 + $ borealis run -c node2.yaml -v > node2.log 2>&1 & 32 + $ NODE2_PID=$! 33 + $ sleep 2 34 + 35 + Inject a bundle from node 1 to node 2: 36 + 37 + $ borealis inject -s 1 -d 2 -m "Hello DTN!" -H 127.0.0.1 -P $PORT2 2>&1 | grep -o "Bundle injected" 38 + Bundle injected 39 + 40 + Check node 2 received the bundle: 41 + 42 + $ sleep 1 43 + $ grep "Accepted connection\|delivered" node2.log | head -1 | grep -o "Accepted connection" 44 + Accepted connection 45 + 46 + Cleanup: 47 + 48 + $ kill $NODE2_PID 2>/dev/null || true 49 + $ wait 2>/dev/null || true