Commit graph

16 commits

Author SHA1 Message Date
Felix Walter
229f884a57 python-ud3tn-utils: Introduce JSON configuration format
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>
2025-06-05 17:03:39 +02:00
Felix Walter
2fd0556f6c test: storage: Improve log output and enforce showing memory leaks
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>
2024-09-30 15:54:28 +02:00
Felix Walter
4e40890c57 test: sqlite: Add test for storage persistence across restarts
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>
2024-09-27 13:29:01 +02:00
Felix Walter
87be9749af Re-integrate v0.13.0 routing code as "integrated default BDM"
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>
2024-07-15 00:46:14 +02:00
Maximilian Nitsch
facd5246b7 test/sqlite_storage: Use run_aap_recv from python-ud3tn-utils package
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>
2024-07-01 10:10:56 +02:00
Maximilian Nitsch
3ba8281796 treewide: Use python-ud3tn-utils scripts instead of those from tools/
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>
2024-07-01 10:10:56 +02:00
Felix Walter
63ea25e52a CI: Fix configuration for compat. BDM in integration tests
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>
2024-06-26 13:32:28 +02:00
Maximilian Nitsch
ed6bdcbf96 SQLiteCLA: Support volatile in-memory database
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>
2024-06-26 09:28:45 +02:00
Felix Walter
e2e7133195 test/storage: Set timeout for Python script to recognize blocking
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>
2024-06-21 11:16:07 +02:00
Felix Walter
52de7a57f8 test: sqlite: Remove unused function
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-06-21 10:36:30 +02:00
Felix Walter
c5bf1b9fee test/functional: Adapt storage test to new behavior
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>
2024-06-21 10:36:30 +02:00
Felix Walter
df07327bef CI: Improve debug output in integration tests
- 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>
2024-06-21 10:36:30 +02:00
Maximilian Nitsch
c3620663ba test: Add Bundle ID based storage agent test
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>
2024-06-03 13:41:58 +02:00
Maximilian Nitsch
85ca529b4d aap2_storage_agent: Add compound-bundle-id argument
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>
2024-06-03 13:41:58 +02:00
Maximilian Nitsch
4fa34c69b3 SQLiteCLA+Agent: Execute select statement in CLA
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>
2024-06-03 13:41:58 +02:00
Maximilian Nitsch
57c1fe225c test/functional: Add SQLite storage test
Adds a simple test to the CI to check if the SQLite storage is working
properly.

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2024-06-03 13:41:58 +02:00