Commit Graph
687 Commits
Author SHA1 Message Date
Jon-Olov VatnandJoachim Wiberg ede1f59479 Minor changes to Infix discovery doc 2023-06-16 16:21:14 +02:00
Jon-Olov VatnandJoachim Wiberg 14712fdc91 Add info on Infix discovery services and possibilities 2023-06-16 16:21:14 +02:00
Tobias WaldekranzandJoachim Wiberg 77f9ca8e2a doc/testing: Add an overview of the test system 2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg 4e69f800de test/case: Add meta/wait to wait for nodes to boot up
When running in the cloud, without KVM emulation, together with many
other tenants, it can take a very long time to boot the instances.

Therefore, add a meta test that will wait for all devices in the
physical topology to come up before exiting. This means that the
actual test cases that follow can assume that devices will answer
NETCONF requests.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg aa8e11a58b test/infamy: Create an infamy specific topology object
Create topology objects that are tailored to represent topologies on
the expected format. This let's us make convenient accessors for
things like the controller node, infix devices, getting the ports used
to reach a certain device from another one, etc.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg 175f7e1c58 x86_64: Make the test environment more customizable
- Collect all test related targets under the test- prefix.

- Add target to run test suite against a `make run` instance. The
  intended use-case is that you are testing out a new build with `make
  run`, and then realize that you want to run some tests.  With this
  change, it is now possible to run `make infix-run-check` from a
  separate terminal - which attaches to the running instance and runs
  the tests.

- Provide -sh targets to spawn interactive environments, which is
  useful during debugging.

- Allow the user to supply a custom suite or list of tests to be run
  by 9PM.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg d75ecf3a1e test/env: Improve usage message 2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg c35553b20a test/env: Allow KVM to be explicitly disabled in the container
This let's us check for timing issues in tests that arise when falling
back to TCG acceleration in QEMU.

While we're here, add a proper option to see the usage message.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg d5b5cffa3b test/env: Provide a wrapper for qeneth to the running topology
With this change, when running an interactive test session, a plain
`qeneth status` will show the status for the network started by
test/env.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg bc3933ad92 test/env: Accept an explicit topology in place of a qeneth network
For now, this is only expected to be used with `-C`, i.e. not in a
containerized environment.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg c76233f5ba test/docker: Add debug tools to container
busybox-extras contains an implementation of telnet, which is needed
for `qeneth console` to work. While we're updating, add tcpdump since
we'll need it sooner or later.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg 7eb2269972 test/infamy: Fix incorrect call when bailing out of MACVLAN creation
We're calling the bound instance of __exit__, so `self` is
superfluous.
2023-06-14 17:40:16 +02:00
Richard AlpeandJoachim Wiberg 723c325b0d statd: add limited operational data for all ifaces
Add oper-status and if-index data to sysrepo for every existing
interface. The origin of the data is the "standard" ip tool with
JSON output.

Current implementation is limited to interfaces existing at startup.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-13 16:39:53 +02:00
Richard AlpeandJoachim Wiberg 75155b72b3 confd: move helper.c to lib
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-13 16:39:53 +02:00
Joachim Wiberg 9e5cf13522 test: debug gh action
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 6c9735a783 .github: shorten job title
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 3afd84fb1a board: minimal builds provide qeneth compatible .img
Minimal builds should probably trigger use of another template in
Infamy, but for now we use this.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 0da9606644 test: infamy: raise exception if dut mgmt ip cannot be found
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 4582b3446c .github: drop this job from regular branches and run after merge
We want Reggie to take most of the hits, then we sail in and build after
the PR has been merged so we can upload new "Nightly" images.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 72c5e18f5c .github: add dedicated regression job for all actions and branches
- Keep build times low, use minimal defconfig and a single arch
 - Focus on the regression testing
 - Allow running on all branches for all users

Goal: when tests pass, reviews can start, if review is good, then merge

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg a4c3d7367b configs: add x86_64_minimal_defconfig
The idea for this is to maintain a smallest-possible type build that can
be used to run regression tests in GitHub Actions.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg c34981cc9f board/common: allow image signing to be optional
Primarily intended for minimal/testing images, but likely also useful
for other use-cases as well.

Defaults remain to sign all images.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Tobias WaldekranzandJoachim Wiberg d28b17bdef .github: Run the test suite as part of the CI on x86_64-netconf 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 225395f749 x86_64: Add convenience target to run the test suite
Once infix has been built, the test suite can now be run by issuing:

    make infix-check
2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg f26bd54336 test: Add a 9PM compatible test suite to run all tests 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 0f76b07625 test: Introduce a standardized test environment 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg d81ca8fcd1 test: Add qeneth topology for running tests in VMs 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 3c0afcdc08 test: Add ietf_interfaces/vlan_ping
Verify that we can communicate with an infix device over a stacked
VLAN interface.
2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg d82da157b6 test: Add ietf_system/hostname 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 0fc720d48a test/infamy: Initial add of python based test library 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 9bead2fca4 qemu: Generate graphviz description of instance
This will be used to run tests against a `make run` instance.
2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg b3e6325c76 9pm: Generic test anything protocol (TAP) runner and expect wizard
The plan is to leverage this for Infix's internal test suite.
2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 60d2b1f105 test: Remove 9pm console lab
Hopefully we won't have to go down the dark path of console parsing,
but if we do, it's good to have this example in the log.
2023-06-08 11:10:31 +02:00
Richard AlpeandJoachim Wiberg 382f428edf confd: add new statd skeleton for operational status
Add a new "statd" module to sysrepo. This module is intended to handle
operational status, i.e. R/O attributes.

In this state, the statd module only retrieves and answers to the
"oper-state" of "eth0". This will be replaced by proper interface
handling and json data processing in upcoming patches. The indent here
is to get the base logistics in place as soon as possible to make life
easier for developers.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-07 13:24:23 +02:00
Richard AlpeandJoachim Wiberg 26391d5381 confd: move srx_module to src/lib
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-07 13:24:23 +02:00
Richard AlpeandJoachim Wiberg 84822390ff confd: move lyx source to new src lib directory
Preparation for statd.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-07 13:24:23 +02:00
Tobias Waldekranz f6a7fe5353 qemu: Allow qemu.sh to be run from any directory
Since qemu.sh is now tied to the directory it's ran from, it makes
sense to change into that directory before starting to resolve any
file paths. This let's us start the script from any directory without
the need for any (cd && qemu) subshell.
2023-06-05 14:07:02 +02:00
Joachim WibergandTobias Waldekranz fd9d3a2723 board: minor shellsheck fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-05 14:07:02 +02:00
Joachim WibergandTobias Waldekranz f8d5c3a9b8 Drop Infix Qemu support from "make menuconfig"
This change drops Qemu menuconfig from the regular 'make menuconfig' in
favor of full release tarball support.  Meaning "make update-defconfig"
will not longer cause unwanted diffs for Qemu defaults checked in when
the defconfigs are updated.

Details:

 - For "make run, run-menuconfig" and bootstrapping qemu.cfg we want to
   use the Buildroot menuconfig system. However, we must set the proper
   environment variables for it to not overwrite our product's .config,
   so the calls to conf and mconf are not pretty.

 - The qemu.sh script can probably be cleaned up further, I've just set
   a CONFIG_ prefix to all variables and dropped any images/ prefix vs.
   the original.  The CONFIG_ prefix is to make the qemu.cfg compatible
   with kconfig-mconf from the kconfig-frontends package.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-05 14:07:02 +02:00
Joachim WibergandTobias Waldekranz 816cf5c370 qemu: add stand-alone menuconfig support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-05 14:07:02 +02:00
Joachim WibergandTobias Waldekranz 93701ae2ef qemu: export Qemu start script in release tarball
First basic step, we also want a menuconfig-like way of changing the
settings, e.g., networking options.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-05 14:07:02 +02:00
Richard AlpeandTobias Waldekranz 4fa89651a7 confd: move src into confd subdirectory
This patch is a preparation for the upcoming "statd" addition.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-05 13:21:01 +02:00
Joachim WibergandTobias Waldekranz 19df588fe4 package/querierd: bump to version 0.10
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-02 18:19:50 +02:00
Joachim Wiberg 646364a6e0 doc: update README and add doc/cli.md
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-02 15:38:40 +02:00
Joachim Wiberg e6ef11a023 configs: fix string syntax, i.e., s/""/"/g
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-02 14:32:49 +02:00
Joachim WibergandTobias Waldekranz c81bc445ca confd: simplify, yang model ensures iftype (+ ifname) is always set
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-01 15:16:39 +02:00
Tobias Waldekranz d82e586687 confd: Infer VLAN parameters for the common <BASE>.<VID> pattern
When adding a new interface to the candidate, if the name matches
<BASE>.<VID>, infer that:

- The parent-interface is <BASE>
- The tag-type is c-vlan
- The vlan-id is <VID>

With this in place, from klish, the following sequence:

configure
set interfaces interface e0.10
leave

Will create a stacked VLAN interface, using VID 10, on top of e0.
2023-06-01 15:16:39 +02:00
Tobias Waldekranz a09a1b922f confd: Generalize VLAN support to arbitrary virtual interfaces
- Make sure that when we need to delete an interface, this is done in
  the exit phase of the generation we're exiting, i.e. it is treated
  as a regular delete.

- When we need to delete and rebuild an interface, make sure that all
  settings and addresses are applied again.  This is done by swapping
  out the diff for the configured data, which we just annotate with
  enough metadata to make it look like a diff.

- Create a dagger dependency from the VLAN to it's parent interface.
  This ensures that the parent interface is properly configured before
  the VLAN is created, which is important when virtual interfaces are
  stacked on top of each other. E.g. a VLAN on top of another VLAN.

- Recreate the VLAN when the parent is changed.

- Fix VLAN tag-type parsing
2023-06-01 15:16:39 +02:00
Tobias Waldekranz 361c0d7827 confd: Move interface deletion logic to its own function
Let's try to keep netdag_gen_iface from becoming do_everything().
2023-06-01 15:16:39 +02:00
Tobias Waldekranz 82aa842cd2 confd: srx: Add helper to query the number of items matching a path
This is useful in candidate inference scenarios where you only want
to infer settings that don't have explicit values set.
2023-06-01 15:16:39 +02:00