diff --git a/.github/workflows/e2e-suites.yml b/.github/workflows/e2e-suites.yml index 6496d910af..2c44f47277 100644 --- a/.github/workflows/e2e-suites.yml +++ b/.github/workflows/e2e-suites.yml @@ -87,6 +87,7 @@ jobs: {"environment":"fedora-podman-rootless","installer":"rpm","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"}, {"environment":"ubuntu-k3s","installer":"k3s","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04"}, {"environment":"ubuntu-k3s","installer":"k3s-ha","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04"}, + {"environment":"ubuntu-docker-rootful-config-push","installer":"deb","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"}, {"environment":"ubuntu-docker-rootful-cdi","installer":"deb","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"}, {"environment":"fedora-podman-rootful-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"}, {"environment":"fedora-podman-rootless-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"}, diff --git a/tasks/test.toml b/tasks/test.toml index 26c2ddd6a5..57784c77a9 100644 --- a/tasks/test.toml +++ b/tasks/test.toml @@ -206,6 +206,12 @@ description = "Run the testkit suites in tests/suites/conformance against a Dock depends = ["e2e:workload:build"] run = "e2e/with-docker-gateway.sh cargo nextest run --locked --manifest-path tests/suites/conformance/Cargo.toml --workspace --test-threads 1 --no-fail-fast" +["e2e:testkit:push"] +description = "Run the conformance suite against a Docker gateway that pushes configuration" +depends = ["e2e:workload:build"] +env = { OPENSHELL_CONFIG_DELIVERY_MODE = "push" } +run = "e2e/with-docker-gateway.sh cargo nextest run --locked --manifest-path tests/suites/conformance/Cargo.toml --workspace --test-threads 1 --no-fail-fast" + ["e2e:rust:push"] description = "Run conformance and policy e2e tests against a Docker gateway that pushes configuration" env = { OPENSHELL_CONFIG_DELIVERY_MODE = "push", OPENSHELL_E2E_DOCKER_FEATURES = "e2e-config-push", OPENSHELL_E2E_DOCKER_TEST = "config_push live_policy_update policy_activation" } diff --git a/tests/tmachine/ansible/playbooks/config-push.yaml b/tests/tmachine/ansible/playbooks/config-push.yaml new file mode 100644 index 0000000000..8753271dbd --- /dev/null +++ b/tests/tmachine/ansible/playbooks/config-push.yaml @@ -0,0 +1,51 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Make the gateway push configuration to supervisors. +# +# Writes `[openshell.gateway] config_delivery_mode = "push"` to +# /etc/openshell-test/gateway-overrides.toml, which the `binaries`, `deb` and +# `rpm` installers apply to the gateway's configuration (k3s installers ignore +# it). +--- +- name: Gateway configuration push for tests + hosts: all + gather_facts: false + vars: + config_push_overrides: /etc/openshell-test/gateway-overrides.toml + tasks: + - name: Wait for SSH + ansible.builtin.wait_for_connection: + + - name: Create the test configuration directory + become: true + ansible.builtin.file: + path: "{{ config_push_overrides | dirname }}" + state: directory + owner: root + group: root + mode: "0755" + + # A managed block keeps tables that earlier playbooks wrote. Some writers + # replace the whole file: drivers/podman/userns.yaml and the cdi_fixtures + # role in environment setup, which must run before this playbook, and the + # openshell_external_driver role in the deb-external-docker-driver + # installer, which always runs after it, so don't pair that installer with + # this environment. + # + # TODO: https://github.com/NVIDIA/OpenShell/pull/5489 installs this file + # as a gateway.d drop-in config, which must declare `[openshell] + # version = 2`. When it lands, add that table here unless an earlier + # writer already does; TOML rejects a table defined twice. + - name: Write the configuration delivery mode + become: true + ansible.builtin.blockinfile: + path: "{{ config_push_overrides }}" + create: true + owner: root + group: root + mode: "0644" + marker: "# {mark} config-push.yaml" + block: | + [openshell.gateway] + config_delivery_mode = "push" diff --git a/tests/tmachine/config.nix b/tests/tmachine/config.nix index 5a41618bf4..fb110fb5d6 100644 --- a/tests/tmachine/config.nix +++ b/tests/tmachine/config.nix @@ -112,6 +112,12 @@ let bases = dockerBases ++ podmanBases; setup.playbooks = [ "ansible/playbooks/cdi.yaml" ]; }; + # A gateway that pushes configuration to supervisors + # (`config_delivery_mode = "push"`), for the conformance family. + config-push = { + bases = dockerBases; + setup.playbooks = [ "ansible/playbooks/config-push.yaml" ]; + }; }; featureEnvironments = pkgs.lib.concatMap ( feature: map (base: withSetup base feature features.${feature}.setup) features.${feature}.bases