This introduces a JSON contact configuration format for the
deterministic first-contact forwarding (DFCF) implementation as a modern
alternative to our homebrewn configuration messages. For now, it is only
supported in the external DFCF BDM, but integration into the "router
agent" is planned.
Example JSON configuration string (from our tests):
```
{
"command": "ADD",
"node_id": "dtn://ud3tn2.dtn/",
"cla_addr": "mtcp:127.0.0.1:4223",
"reachable_eids": [
"ipn:1.0"
],
"contact_list": [
{
"start": 1401519306972,
"end": 1401519316972,
"data_rate": 2400,
"reachable_eids": [
"dtn://66553/",
"dtn://89326/"
]
},
{
"start": 1401519506972,
"end": 1401519516972,
"data_rate": 1200,
"reachable_eids": [
"dtn://12349/",
"dtn://89326/"
]
}
]
}
```
Closes: #15
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This makes the test show *all* logs in a sensible order and also enables
the display of memory leaks plus backtrace in case ASAN with leak checker
is active.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This restarts µD3TN and the BDM after sending a bundle and triggers
sending it again after restarting both services.
Closes: #222
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This makes µD3TN behave the same as v0.13.0 when executed without an
additional commandline argument. A new commandline argument `-d` /
`--external-dispatch` is added, which enables the use of external BDMs.
The default forwarding implementation is now again provided using the
v0.13 code, extracted from e1621765a4 and
adapted to the new agent-based forwarding implementation.
Central changes to the old code include:
- A new "Routing Agent" that handles incoming configuration commands,
FIB updates, and BDM dispatch requests.
- The use of the BDM authorization flag to authorize contact
configuration commands.
- The Contact Manager now only triggers the creation and removal of
links / FIB entries; bundle dispatch is triggered through the FIB and
BDM callback functions of the Routing Agent.
- The fragmentation logic is adapted to store the original bundle along
with an offset and length value, instead of pre-creating and storing
the fragments.
- The bundle re-scheduling logic integrated into the Routing Agent is
simplified and does not support changing the fragmentation parameters.
A new function is added to the Router that searches for a new route
for such fragments that were already scheduled at some point,
considering them as un-fragmentable bundle with overridden fragment
offset and length.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Use the `run_aap_recv()` function from the python-ud3tn-utils package
instead of copying the code.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
Changes all occurrences of the old script paths from tools/ to the
scripts installed by python-ud3tn-utils.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
- Moves `tools/aap` + `tools/aap2` to `python-ud3tn-utils/aap*/bin/` to
add the scripts to the python package
- Adds a `main()` function to each script to reference it
- Define `logger` as global variable
- Adds a symbolic link to keep compatibility with existing tooling
- Moves `tools/aap/aap_test.py` to `test/functional/`
- Adds additional dependencies (pyd3tn, cbor) to python-ud3tn-utils and
the corresponding nix package
- Add scripts to python-ud3tn-utils `pyproject.toml`
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
We must either allow accepting configuration from an external source or
use the AAPv2 method with authentication for the integration tests to
work. This uses one of both approaches in each of the tests, so both are
also validated to work.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Adds support for a volatile in-memory database by enabling support for
URI-based database file names. Since the in-memory DB can only be
accessed within the process, the integration tests are changed so that
external SQL queries are only performed when a persistent DB file is
used.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
In rare cases the script blocked until it was killed in CI, preventing
uD3TN logs to be printed. We thus add a reasonable timeout to terminate
it proactively in case of blocking, so we can examine the logs.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This makes the storage test operate in conjunction with the AAP 2.0
compatibility BDM:
- A compat. BDM is launched for storage_agent_bundle_id_test.py
- storage_agent_bundle_id_test.py now does not manually push and delete
bundles but rather checks the database contents at different stages of
bundle handling through the BDM.
- aap2_storage_agent_metadata_test.sh is adapted such that it uses the
static dispatcher to move bundles in and out of storage and check the
DB contents in between
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
- Make `timeout` verbose: pass `-v` so we see when the operation timed
out.
- Check for clean exit only *after* printing the logs: We should be able
to see the logs even if uD3TN crashes.
- Increase log verbosity.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Test to verify that the identification of bundles based on their unique
bundle ID works within the storage CLA and the agent.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
To identify a specific bundle, a command line argument is added to
specify the composite bundle ID based on source, destination, creation
timestamp, sequence number, fragment offset and payload length.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
To eliminate potential race conditions where rows are deleted before the
CLA processes them, the select statement is moved from the agent to the
CLA and everything is wrapped in a transaction to read all or nothing.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
This always specifies the AAPv2 socket path so we ensure that no two
instances of uD3TN listen on the same AAPv2 socket in tests.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This allows for capturing sanitizer warnings in the test and removes the
need to kill all uD3TN instances (just those launched by the test).
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This adapts the BIBE test to the behavior of the other functional tests
(ION interoperability), expecting the dependencies to be present when
run. The CI config is adapted to use the prepared Docker image,
preventing reinstallation of Python dependencies during the CI job.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This makes the testing logs prettier and may help in decoding the
responses received by aap_receive.py.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
We do not need this anymore due to making logging line-buffered and it
collides with ASAN in some cases.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This enables ASAN and UBSAN in our unit and integration tests.
Another integration test using the thread (data race) sanitizer is added
to detect such issues as well.
The tests are extended such that they wait for uD3TN (all instances if
we launch multiple ones) to terminate, to allow for exit checks of
sanitizers to run. For example, ASAN and the thread sanitizer make use
of this and we need to obtain the exit status code to tell whether the
CI job succeeded or not.
Note that memory leak detection is turned off in the unit tests as they
do not properly deallocate temporary variables, see: #104
aap_send and aap_receive are always invoked with `-v` to get more
information on what happens there in the tests.
Fixes: #55
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
ud3tn is available under multiple licenses and we want to reflect this in
our source code. But which license information should appear first and how
can we manage this efficiently in the future? The Linux Kernel uses SPDX
expressions instead of boilerplate sections. This seems to be a great
approach, so we do the same here.
Signed-off-by: Georg Alexander Murzik <georg.murzik@d3tn.com>
This commit renames the functional test bibe_forwarding_internally_test
to bibe_internal_forwarding_test. It also adds a short description of
what the test is about at the top of the run.sh file in the test direc-
tory.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
This commit adds two tests regarding Bundle-in-Bundle Encapsulation.
The first test starts four µD3TN instances and tests whether sending
and receiving BIBE messages works as expected, whereas the second
test specifically checks the encoding of BIBE messages by the
bibe_proto.c file.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>