File: test_integration_edge.sh

package info (click to toggle)
n2n 3.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,776 kB
  • sloc: ansic: 29,672; sh: 1,502; python: 621; makefile: 442; perl: 270; exp: 4
file content (47 lines) | stat: -rwxr-xr-x 1,038 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#
# Do some quick tests via the Json API against the edge
#

AUTH=n2n

# boilerplate so we can support whaky cmake dirs
[ -z "$TOPDIR" ] && TOPDIR=.
[ -z "$BINDIR" ] && BINDIR=.

docmd() {
    echo "###"
    "$@"
    echo
}

# start a supernode
docmd ${BINDIR}/supernode -v

# TODO:
# - send edge messages to stderr?

docmd ${TOPDIR}/scripts/n2n-ctl communities
docmd ${TOPDIR}/scripts/n2n-ctl packetstats
docmd ${TOPDIR}/scripts/n2n-ctl edges --raw

# TODO:
# docmd ${TOPDIR}/scripts/n2n-ctl supernodes --raw
# - need fixed mac address
# - need to mask out:
#   - version string
#   - last_seen timestamp
#   - uptime

docmd ${TOPDIR}/scripts/n2n-ctl verbose
docmd ${TOPDIR}/scripts/n2n-ctl --write verbose 1 2>/dev/null
echo $?
docmd ${TOPDIR}/scripts/n2n-ctl -k $AUTH --write verbose 1

# looks strange, but we are querying the state of the "stop" verb
docmd ${TOPDIR}/scripts/n2n-ctl stop

# stop them both
docmd ${TOPDIR}/scripts/n2n-ctl -k $AUTH --write stop
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 -k $AUTH --write stop