From 2daf8e1e67a0985b926b384527fb8d3e6e39bf57 Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Thu, 12 Dec 2024 13:26:06 +0000 Subject: [PATCH 1/8] manifest: Basic tests for new, download and install use cases --- .../dnf/plugins-core/manifest.feature | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 dnf-behave-tests/dnf/plugins-core/manifest.feature diff --git a/dnf-behave-tests/dnf/plugins-core/manifest.feature b/dnf-behave-tests/dnf/plugins-core/manifest.feature new file mode 100644 index 000000000..070663c59 --- /dev/null +++ b/dnf-behave-tests/dnf/plugins-core/manifest.feature @@ -0,0 +1,162 @@ +Feature: Tests for the manifest plugin + + +Background: + Given I enable plugin "manifest" + And I use repository "dnf-ci-fedora" + And I successfully execute dnf with args "install basesystem glibc flac" + And I set working directory to "{context.dnf.tempdir}" + + +Scenario: Generate new manifest using specs + When I execute dnf with args "manifest new abcde http-parser" + Then the exit code is 0 + And file "/{context.dnf.tempdir}/packages.manifest.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: dnf-ci-fedora + baseurl: * + packages: + noarch: + - name: abcde + repo_id: dnf-ci-fedora + location: noarch/abcde-2.9.2-1.fc29.noarch.rpm + checksum: sha256:* + size: * + evr: 2.9.2-1.fc29 + x86_64: + - name: wget + repo_id: dnf-ci-fedora + location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.19.5-5.fc29 + - name: flac + repo_id: dnf-ci-fedora + location: x86_64/flac-1.3.2-8.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.3.2-8.fc29 + - name: http-parser + repo_id: dnf-ci-fedora + location: x86_64/http-parser-2.4.0-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 2.4.0-1.fc29 + """ + +Scenario: Generate new manifest using specs and system repo + When I execute dnf with args "manifest new abcde http-parser --use-system" + Then the exit code is 0 + And file "/{context.dnf.tempdir}/packages.manifest.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: dnf-ci-fedora + baseurl: * + packages: + noarch: + - name: abcde + repo_id: dnf-ci-fedora + location: noarch/abcde-2.9.2-1.fc29.noarch.rpm + checksum: sha256:* + size: * + evr: 2.9.2-1.fc29 + x86_64: + - name: http-parser + repo_id: dnf-ci-fedora + location: x86_64/http-parser-2.4.0-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 2.4.0-1.fc29 + - name: wget + repo_id: dnf-ci-fedora + location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.19.5-5.fc29 + """ + +Scenario: Generate new manifest using installed packages + When I execute dnf with args "manifest new" + Then the exit code is 0 + And file "/{context.dnf.tempdir}/packages.manifest.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: dnf-ci-fedora + baseurl: * + packages: + noarch: + - name: basesystem + repo_id: dnf-ci-fedora + location: noarch/basesystem-11-6.fc29.noarch.rpm + checksum: sha256:* + size: * + evr: 11-6.fc29 + - name: setup + repo_id: dnf-ci-fedora + location: noarch/setup-2.12.1-1.fc29.noarch.rpm + checksum: sha256:* + size: * + evr: 2.12.1-1.fc29 + x86_64: + - name: filesystem + repo_id: dnf-ci-fedora + location: x86_64/filesystem-3.9-2.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 3.9-2.fc29 + - name: flac + repo_id: dnf-ci-fedora + location: x86_64/flac-1.3.2-8.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.3.2-8.fc29 + - name: glibc + repo_id: dnf-ci-fedora + location: x86_64/glibc-2.28-9.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 2.28-9.fc29 + - name: glibc-all-langpacks + repo_id: dnf-ci-fedora + location: x86_64/glibc-all-langpacks-2.28-9.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 2.28-9.fc29 + - name: glibc-common + repo_id: dnf-ci-fedora + location: x86_64/glibc-common-2.28-9.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 2.28-9.fc29 + """ + +Scenario: Download packages from the manifest + Given I successfully execute dnf with args "manifest new abcde http-parser" + When I execute dnf with args "manifest download" + Then the exit code is 0 + And file sha256 checksums are following + | Path | sha256 | + | {context.dnf.tempdir}/packages.manifest/abcde-2.9.2-1.fc29.noarch.rpm | file://{context.dnf.fixturesdir}/repos/dnf-ci-fedora/noarch/abcde-2.9.2-1.fc29.noarch.rpm | + | {context.dnf.tempdir}/packages.manifest/flac-1.3.2-8.fc29.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/dnf-ci-fedora/x86_64/flac-1.3.2-8.fc29.x86_64.rpm | + | {context.dnf.tempdir}/packages.manifest/http-parser-2.4.0-1.fc29.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/dnf-ci-fedora/x86_64/http-parser-2.4.0-1.fc29.x86_64.rpm | + | {context.dnf.tempdir}/packages.manifest/wget-1.19.5-5.fc29.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/dnf-ci-fedora/x86_64/wget-1.19.5-5.fc29.x86_64.rpm | + +Scenario: Install packages from the manifest + Given I successfully execute dnf with args "manifest new abcde http-parser" + When I execute dnf with args "manifest install" + Then the exit code is 0 + And Transaction is following + | Action | Package | + | install | abcde-0:2.9.2-1.fc29.noarch | + | install | http-parser-0:2.4.0-1.fc29.x86_64 | + | install | wget-0:1.19.5-5.fc29.x86_64 | From c2b2bd7ec9f41bf26c24b3df8c24049ccbe53e45 Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Thu, 12 Dec 2024 13:27:39 +0000 Subject: [PATCH 2/8] manifest: Add checksum validation test --- dnf-behave-tests/dnf/plugins-core/manifest.feature | 8 ++++++++ dnf-behave-tests/requirements.spec | 1 + 2 files changed, 9 insertions(+) diff --git a/dnf-behave-tests/dnf/plugins-core/manifest.feature b/dnf-behave-tests/dnf/plugins-core/manifest.feature index 070663c59..b86db17f2 100644 --- a/dnf-behave-tests/dnf/plugins-core/manifest.feature +++ b/dnf-behave-tests/dnf/plugins-core/manifest.feature @@ -48,6 +48,14 @@ Scenario: Generate new manifest using specs evr: 2.4.0-1.fc29 """ +Scenario: Non-installed package from manifest has matching checksum + Given I successfully execute dnf with args "manifest new wget" + And I successfully execute dnf with args "manifest download" + When I execute "sha256sum packages.manifest/wget-1.19.5-5.fc29.x86_64.rpm | cut -d' ' -f1 > real-checksum" + And I execute "yq '.data.packages.x86_64[].checksum' packages.manifest.yaml | cut -d':' -f2 > manifest-checksum" + And I execute "diff real-checksum manifest-checksum" + Then the exit code is 0 + Scenario: Generate new manifest using specs and system repo When I execute dnf with args "manifest new abcde http-parser --use-system" Then the exit code is 0 diff --git a/dnf-behave-tests/requirements.spec b/dnf-behave-tests/requirements.spec index 8458346d1..3f18bf588 100644 --- a/dnf-behave-tests/requirements.spec +++ b/dnf-behave-tests/requirements.spec @@ -32,6 +32,7 @@ BuildRequires: python3-setuptools BuildRequires: rpm-build BuildRequires: rpm-sign BuildRequires: sqlite +BuildRequires: yq BuildRequires: zstd %if 0%{?fedora} BuildRequires: python3-behave < 1.2.7 From 9a437339a2826fc072b163efc46ba7ae5a6fca21 Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Thu, 12 Dec 2024 13:28:50 +0000 Subject: [PATCH 3/8] manifest: Basic tests for using prototype input file --- .../dnf/plugins-core/manifest.feature | 119 ++++++++++++++++++ .../fixtures/data/manifest/rpms.in.yaml | 10 ++ 2 files changed, 129 insertions(+) create mode 100644 dnf-behave-tests/fixtures/data/manifest/rpms.in.yaml diff --git a/dnf-behave-tests/dnf/plugins-core/manifest.feature b/dnf-behave-tests/dnf/plugins-core/manifest.feature index b86db17f2..bc43fb64f 100644 --- a/dnf-behave-tests/dnf/plugins-core/manifest.feature +++ b/dnf-behave-tests/dnf/plugins-core/manifest.feature @@ -90,6 +90,125 @@ Scenario: Generate new manifest using specs and system repo evr: 1.19.5-5.fc29 """ +Scenario: Generate new manifest using prototype input file + Given I copy file "{context.dnf.fixturesdir}/data/manifest/rpms.in.yaml" to "/{context.dnf.tempdir}" + And I execute "sed -i 's|$FIXTURES_DIR|{context.dnf.fixturesdir}|' rpms.in.yaml" + When I execute dnf with args "manifest new" + Then the exit code is 0 + And file "/{context.dnf.tempdir}/packages.manifest.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: dnf-ci-fedora + baseurl: * + packages: + noarch: + - name: basesystem + repo_id: dnf-ci-fedora + location: noarch/basesystem-11-6.fc29.noarch.rpm + checksum: sha256:* + size: * + evr: 11-6.fc29 + - name: setup + repo_id: dnf-ci-fedora + location: noarch/setup-2.12.1-1.fc29.noarch.rpm + checksum: sha256:* + size: * + evr: 2.12.1-1.fc29 + x86_64: + - name: wget + repo_id: dnf-ci-fedora + location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.19.5-5.fc29 + - name: nodejs + repo_id: dnf-ci-fedora + location: x86_64/nodejs-5.12.1-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1:5.12.1-1.fc29 + - name: dwm + repo_id: dnf-ci-fedora + location: x86_64/dwm-6.1-1.x86_64.rpm + checksum: sha256:* + size: * + evr: 6.1-1 + - name: npm + repo_id: dnf-ci-fedora + location: x86_64/npm-5.12.1-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1:5.12.1-1.fc29 + - name: filesystem + repo_id: dnf-ci-fedora + location: x86_64/filesystem-3.9-2.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 3.9-2.fc29 + - name: glibc + repo_id: dnf-ci-fedora + location: x86_64/glibc-2.28-9.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 2.28-9.fc29 + - name: glibc-all-langpacks + repo_id: dnf-ci-fedora + location: x86_64/glibc-all-langpacks-2.28-9.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 2.28-9.fc29 + - name: glibc-common + repo_id: dnf-ci-fedora + location: x86_64/glibc-common-2.28-9.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 2.28-9.fc29 + """ + +Scenario: Generate new manifest using prototype input file and system repo + Given I copy file "{context.dnf.fixturesdir}/data/manifest/rpms.in.yaml" to "/{context.dnf.tempdir}" + And I execute "sed -i 's|$FIXTURES_DIR|{context.dnf.fixturesdir}|' rpms.in.yaml" + When I execute dnf with args "manifest new --use-system" + Then the exit code is 0 + And file "/{context.dnf.tempdir}/packages.manifest.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: dnf-ci-fedora + baseurl: * + packages: + x86_64: + - name: dwm + repo_id: dnf-ci-fedora + location: x86_64/dwm-6.1-1.x86_64.rpm + checksum: sha256:* + size: * + evr: 6.1-1 + - name: npm + repo_id: dnf-ci-fedora + location: x86_64/npm-5.12.1-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1:5.12.1-1.fc29 + - name: wget + repo_id: dnf-ci-fedora + location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.19.5-5.fc29 + - name: nodejs + repo_id: dnf-ci-fedora + location: x86_64/nodejs-5.12.1-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1:5.12.1-1.fc29 + """ + Scenario: Generate new manifest using installed packages When I execute dnf with args "manifest new" Then the exit code is 0 diff --git a/dnf-behave-tests/fixtures/data/manifest/rpms.in.yaml b/dnf-behave-tests/fixtures/data/manifest/rpms.in.yaml new file mode 100644 index 000000000..7f9adbfdf --- /dev/null +++ b/dnf-behave-tests/fixtures/data/manifest/rpms.in.yaml @@ -0,0 +1,10 @@ +contentOrigin: + repos: + - repoid: dnf-ci-fedora + baseurl: file://$FIXTURES_DIR/repos/dnf-ci-fedora +packages: + - dwm + - npm + - wget +arches: + - x86_64 From 4c0d2dbc9ae65d574edfe7da33bfeaa12d1435de Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Thu, 12 Dec 2024 13:14:06 +0000 Subject: [PATCH 4/8] manifest: Add tests for reinstallPackages, module enable and allowErasing --- .../dnf/plugins-core/manifest.feature | 238 +++++++++++++++--- .../data/manifest/allowerasing.in.yaml | 9 + .../data/manifest/moduleenable.in.yaml | 10 + .../fixtures/data/manifest/reinstall.in.yaml | 10 + .../manifest/{rpms.in.yaml => simple.in.yaml} | 0 5 files changed, 237 insertions(+), 30 deletions(-) create mode 100644 dnf-behave-tests/fixtures/data/manifest/allowerasing.in.yaml create mode 100644 dnf-behave-tests/fixtures/data/manifest/moduleenable.in.yaml create mode 100644 dnf-behave-tests/fixtures/data/manifest/reinstall.in.yaml rename dnf-behave-tests/fixtures/data/manifest/{rpms.in.yaml => simple.in.yaml} (100%) diff --git a/dnf-behave-tests/dnf/plugins-core/manifest.feature b/dnf-behave-tests/dnf/plugins-core/manifest.feature index bc43fb64f..78a55b1b1 100644 --- a/dnf-behave-tests/dnf/plugins-core/manifest.feature +++ b/dnf-behave-tests/dnf/plugins-core/manifest.feature @@ -28,12 +28,6 @@ Scenario: Generate new manifest using specs size: * evr: 2.9.2-1.fc29 x86_64: - - name: wget - repo_id: dnf-ci-fedora - location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm - checksum: sha256:* - size: * - evr: 1.19.5-5.fc29 - name: flac repo_id: dnf-ci-fedora location: x86_64/flac-1.3.2-8.fc29.x86_64.rpm @@ -46,16 +40,25 @@ Scenario: Generate new manifest using specs checksum: sha256:* size: * evr: 2.4.0-1.fc29 + - name: wget + repo_id: dnf-ci-fedora + location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.19.5-5.fc29 """ + +# Check that the real checksum of RPM package is the same one as in the manifest file Scenario: Non-installed package from manifest has matching checksum - Given I successfully execute dnf with args "manifest new wget" + Given I successfully execute dnf with args "manifest new wget --use-system" And I successfully execute dnf with args "manifest download" When I execute "sha256sum packages.manifest/wget-1.19.5-5.fc29.x86_64.rpm | cut -d' ' -f1 > real-checksum" And I execute "yq '.data.packages.x86_64[].checksum' packages.manifest.yaml | cut -d':' -f2 > manifest-checksum" And I execute "diff real-checksum manifest-checksum" Then the exit code is 0 + Scenario: Generate new manifest using specs and system repo When I execute dnf with args "manifest new abcde http-parser --use-system" Then the exit code is 0 @@ -90,8 +93,9 @@ Scenario: Generate new manifest using specs and system repo evr: 1.19.5-5.fc29 """ + Scenario: Generate new manifest using prototype input file - Given I copy file "{context.dnf.fixturesdir}/data/manifest/rpms.in.yaml" to "/{context.dnf.tempdir}" + Given I copy file "{context.dnf.fixturesdir}/data/manifest/simple.in.yaml" to "/{context.dnf.tempdir}/rpms.in.yaml" And I execute "sed -i 's|$FIXTURES_DIR|{context.dnf.fixturesdir}|' rpms.in.yaml" When I execute dnf with args "manifest new" Then the exit code is 0 @@ -118,30 +122,12 @@ Scenario: Generate new manifest using prototype input file size: * evr: 2.12.1-1.fc29 x86_64: - - name: wget - repo_id: dnf-ci-fedora - location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm - checksum: sha256:* - size: * - evr: 1.19.5-5.fc29 - - name: nodejs - repo_id: dnf-ci-fedora - location: x86_64/nodejs-5.12.1-1.fc29.x86_64.rpm - checksum: sha256:* - size: * - evr: 1:5.12.1-1.fc29 - name: dwm repo_id: dnf-ci-fedora location: x86_64/dwm-6.1-1.x86_64.rpm checksum: sha256:* size: * evr: 6.1-1 - - name: npm - repo_id: dnf-ci-fedora - location: x86_64/npm-5.12.1-1.fc29.x86_64.rpm - checksum: sha256:* - size: * - evr: 1:5.12.1-1.fc29 - name: filesystem repo_id: dnf-ci-fedora location: x86_64/filesystem-3.9-2.fc29.x86_64.rpm @@ -166,10 +152,29 @@ Scenario: Generate new manifest using prototype input file checksum: sha256:* size: * evr: 2.28-9.fc29 + - name: nodejs + repo_id: dnf-ci-fedora + location: x86_64/nodejs-5.12.1-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1:5.12.1-1.fc29 + - name: npm + repo_id: dnf-ci-fedora + location: x86_64/npm-5.12.1-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1:5.12.1-1.fc29 + - name: wget + repo_id: dnf-ci-fedora + location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.19.5-5.fc29 """ + Scenario: Generate new manifest using prototype input file and system repo - Given I copy file "{context.dnf.fixturesdir}/data/manifest/rpms.in.yaml" to "/{context.dnf.tempdir}" + Given I copy file "{context.dnf.fixturesdir}/data/manifest/simple.in.yaml" to "/{context.dnf.tempdir}/rpms.in.yaml" And I execute "sed -i 's|$FIXTURES_DIR|{context.dnf.fixturesdir}|' rpms.in.yaml" When I execute dnf with args "manifest new --use-system" Then the exit code is 0 @@ -189,6 +194,12 @@ Scenario: Generate new manifest using prototype input file and system repo checksum: sha256:* size: * evr: 6.1-1 + - name: nodejs + repo_id: dnf-ci-fedora + location: x86_64/nodejs-5.12.1-1.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1:5.12.1-1.fc29 - name: npm repo_id: dnf-ci-fedora location: x86_64/npm-5.12.1-1.fc29.x86_64.rpm @@ -201,14 +212,179 @@ Scenario: Generate new manifest using prototype input file and system repo checksum: sha256:* size: * evr: 1.19.5-5.fc29 - - name: nodejs + """ + + +# This use case involves loading the system repository with the flac package installed. +# The flac package is also specified in the input file, but as a package for reinstallation, so it should be resolved in the manifest. +Scenario: Generate new manifest with packages for reinstallation using prototype input file and system repo + Given I copy file "{context.dnf.fixturesdir}/data/manifest/reinstall.in.yaml" to "/{context.dnf.tempdir}/rpms.in.yaml" + And I execute "sed -i 's|$FIXTURES_DIR|{context.dnf.fixturesdir}|' rpms.in.yaml" + When I execute dnf with args "manifest new --use-system" + Then the exit code is 0 + And file "/{context.dnf.tempdir}/packages.manifest.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: dnf-ci-fedora + baseurl: * + packages: + x86_64: + - name: flac repo_id: dnf-ci-fedora - location: x86_64/nodejs-5.12.1-1.fc29.x86_64.rpm + location: x86_64/flac-1.3.2-8.fc29.x86_64.rpm checksum: sha256:* size: * - evr: 1:5.12.1-1.fc29 + evr: 1.3.2-8.fc29 + - name: wget + repo_id: dnf-ci-fedora + location: x86_64/wget-1.19.5-5.fc29.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.19.5-5.fc29 """ + +# Try to install the dnf-ci-conflict package which conflicts with dnf-ci-kernel +# Also excluding the dnf-ci-obsolete which is a obsoleter of dnf-ci-kernel +# This ^ is only possible when --allow-erasing is passed +Scenario: Generate new manifest using prototype input file, system repo and allow erasing + Given I use repository "protect-running-kernel" + And I successfully execute dnf with args "install dnf-ci-kernel-1.0" + And I copy file "{context.dnf.fixturesdir}/data/manifest/allowerasing.in.yaml" to "/{context.dnf.tempdir}/rpms.in.yaml" + And I execute "sed -i 's|$FIXTURES_DIR|{context.dnf.fixturesdir}|' rpms.in.yaml" + When I execute dnf with args "manifest new --use-system --exclude dnf-ci-obsolete" + Then the exit code is 0 + And file "/{context.dnf.tempdir}/packages.manifest.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: protect-running-kernel + baseurl: * + packages: + x86_64: + - name: dnf-ci-conflict + repo_id: protect-running-kernel + location: x86_64/dnf-ci-conflict-1.0-1.x86_64.rpm + checksum: sha256:* + size: * + evr: 1.0-1 + """ + + +Scenario: Generate new manifest using prototype input file with a modular package from the enabled stream + Given I use repository "dnf-ci-fedora-modular" + And I copy file "{context.dnf.fixturesdir}/data/manifest/moduleenable.in.yaml" to "/{context.dnf.tempdir}/rpms.in.yaml" + And I execute "sed -i 's|$FIXTURES_DIR|{context.dnf.fixturesdir}|' rpms.in.yaml" + When I execute dnf with args "manifest new --use-system" + Then the exit code is 0 + And file "/{context.dnf.tempdir}/packages.manifest.yaml" contains lines + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: dnf-ci-fedora-modular + baseurl: * + packages: + x86_64: + - name: nodejs + repo_id: dnf-ci-fedora-modular + location: x86_64/nodejs-10.11.0-1.module_2200* + checksum: sha256:* + size: * + evr: 1:10.11.0-1.module_2200* + module: nodejs:10 + - name: npm + repo_id: dnf-ci-fedora-modular + location: x86_64/npm-10.11.0-1.module_2200* + checksum: sha256:* + size: * + evr: 1:10.11.0-1.module_2200* + module: nodejs:10 + ... + --- + document: modulemd + version: 2 + data: + name: nodejs + stream: "10" + version: 20180920144631 + context: 6c81f848 + arch: x86_64 + summary: Javascript runtime + description: >- + Node.js is a platform built on Chrome''s JavaScript runtime for easily building + fast, scalable network applications. Node.js uses an event-driven, non-blocking + I/O model that makes it lightweight and efficient, perfect for data-intensive + real-time applications that run across distributed devices. + license: + module: + - MIT + content: + - MIT + - MIT and ASL 2.0 and ISC and BSD + - MIT and BSD and ISC + dependencies: + - buildrequires: + platform: * + requires: + platform: * + references: + community: http://nodejs.org + documentation: http://nodejs.org/en/docs + tracker: https://github.com/nodejs/node/issues + profiles: + default: + rpms: + - nodejs + - npm + development: + rpms: + - nodejs + - nodejs-devel + - npm + minimal: + rpms: + - nodejs + api: + rpms: + - nodejs + - nodejs-devel + - npm + components: + rpms: + libuv: + rationale: Platform abstraction layer for Node.js + repository: git* + cache: https://src.fedoraproject.org/repo/pkgs/libuv + ref: "1" + nghttp2: + rationale: Needed for HTTP2 support + repository: git* + cache: https://src.fedoraproject.org/repo/pkgs/nghttp2 + ref: master + nodejs: + rationale: Javascript runtime and npm package manager. + repository: git* + cache: https://src.fedoraproject.org/repo/pkgs/nodejs + ref: "10" + buildorder: 10 + artifacts: + rpms: + - nodejs-1:10.11.0-1.module_2200* + - nodejs-1:10.11.0-1.module_2200* + - nodejs-devel-1:10.11.0-1.module_2200* + - nodejs-docs-1:10.11.0-1.module_2200* + - npm-1:10.11.0-1.module_2200* + ... + """ + + Scenario: Generate new manifest using installed packages When I execute dnf with args "manifest new" Then the exit code is 0 @@ -267,6 +443,7 @@ Scenario: Generate new manifest using installed packages evr: 2.28-9.fc29 """ + Scenario: Download packages from the manifest Given I successfully execute dnf with args "manifest new abcde http-parser" When I execute dnf with args "manifest download" @@ -278,6 +455,7 @@ Scenario: Download packages from the manifest | {context.dnf.tempdir}/packages.manifest/http-parser-2.4.0-1.fc29.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/dnf-ci-fedora/x86_64/http-parser-2.4.0-1.fc29.x86_64.rpm | | {context.dnf.tempdir}/packages.manifest/wget-1.19.5-5.fc29.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/dnf-ci-fedora/x86_64/wget-1.19.5-5.fc29.x86_64.rpm | + Scenario: Install packages from the manifest Given I successfully execute dnf with args "manifest new abcde http-parser" When I execute dnf with args "manifest install" diff --git a/dnf-behave-tests/fixtures/data/manifest/allowerasing.in.yaml b/dnf-behave-tests/fixtures/data/manifest/allowerasing.in.yaml new file mode 100644 index 000000000..c02adb58d --- /dev/null +++ b/dnf-behave-tests/fixtures/data/manifest/allowerasing.in.yaml @@ -0,0 +1,9 @@ +contentOrigin: + repos: + - repoid: protect-running-kernel + baseurl: file://$FIXTURES_DIR/repos/protect-running-kernel +packages: + - dnf-ci-conflict +arches: + - x86_64 +allowerasing: true diff --git a/dnf-behave-tests/fixtures/data/manifest/moduleenable.in.yaml b/dnf-behave-tests/fixtures/data/manifest/moduleenable.in.yaml new file mode 100644 index 000000000..5b5fbe3a1 --- /dev/null +++ b/dnf-behave-tests/fixtures/data/manifest/moduleenable.in.yaml @@ -0,0 +1,10 @@ +contentOrigin: + repos: + - repoid: dnf-ci-fedora-modular + baseurl: file://$FIXTURES_DIR/repos/dnf-ci-fedora-modular +packages: + - nodejs +moduleEnable: + - nodejs:10 +arches: + - x86_64 diff --git a/dnf-behave-tests/fixtures/data/manifest/reinstall.in.yaml b/dnf-behave-tests/fixtures/data/manifest/reinstall.in.yaml new file mode 100644 index 000000000..2b77239c4 --- /dev/null +++ b/dnf-behave-tests/fixtures/data/manifest/reinstall.in.yaml @@ -0,0 +1,10 @@ +contentOrigin: + repos: + - repoid: dnf-ci-fedora + baseurl: file://$FIXTURES_DIR/repos/dnf-ci-fedora +packages: + - wget +reinstallPackages: + - flac +arches: + - x86_64 diff --git a/dnf-behave-tests/fixtures/data/manifest/rpms.in.yaml b/dnf-behave-tests/fixtures/data/manifest/simple.in.yaml similarity index 100% rename from dnf-behave-tests/fixtures/data/manifest/rpms.in.yaml rename to dnf-behave-tests/fixtures/data/manifest/simple.in.yaml From 44aa7ea40d22770ba5fdf1044659a56f124c6f0d Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Fri, 28 Feb 2025 13:03:13 +0000 Subject: [PATCH 5/8] manifest: Basic tests for multiarch manifest files --- .../dnf/plugins-core/manifest.feature | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/dnf-behave-tests/dnf/plugins-core/manifest.feature b/dnf-behave-tests/dnf/plugins-core/manifest.feature index 78a55b1b1..cbd7d3833 100644 --- a/dnf-behave-tests/dnf/plugins-core/manifest.feature +++ b/dnf-behave-tests/dnf/plugins-core/manifest.feature @@ -444,6 +444,35 @@ Scenario: Generate new manifest using installed packages """ +Scenario: Generate new multiarch manifest file + Given I use repository "security-upgrade-multilib" + And I successfully execute dnf with args "manifest new B-1-1 --archs x86_64 i686" + Then file "/{context.dnf.tempdir}/packages.manifest.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: security-upgrade-multilib + baseurl: file:///root/dbox/ci-dnf-stack/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ + packages: + i686: + - name: B + repo_id: security-upgrade-multilib + location: i686/B-1-1.i686.rpm + checksum: sha256:* + size: * + evr: 1-1 + x86_64: + - name: B + repo_id: security-upgrade-multilib + location: x86_64/B-1-1.x86_64.rpm + checksum: sha256:* + size: * + evr: 1-1 + """ + + Scenario: Download packages from the manifest Given I successfully execute dnf with args "manifest new abcde http-parser" When I execute dnf with args "manifest download" @@ -456,6 +485,17 @@ Scenario: Download packages from the manifest | {context.dnf.tempdir}/packages.manifest/wget-1.19.5-5.fc29.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/dnf-ci-fedora/x86_64/wget-1.19.5-5.fc29.x86_64.rpm | +Scenario: Download multiarch packages from the manifest + Given I use repository "security-upgrade-multilib" + And I successfully execute dnf with args "manifest new B-1-1 --archs x86_64 i686" + When I execute dnf with args "manifest download --archs x86_64 i686" + Then the exit code is 0 + And file sha256 checksums are following + | Path | sha256 | + | {context.dnf.tempdir}/packages.manifest/B-1-1.i686.rpm | file://{context.dnf.fixturesdir}/repos/security-upgrade-multilib/i686/B-1-1.i686.rpm | + | {context.dnf.tempdir}/packages.manifest/B-1-1.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/security-upgrade-multilib/x86_64/B-1-1.x86_64.rpm | + + Scenario: Install packages from the manifest Given I successfully execute dnf with args "manifest new abcde http-parser" When I execute dnf with args "manifest install" From 062bbfe68a11e89af8ce556a16f0271fdd1ce069 Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Mon, 3 Mar 2025 09:31:14 +0000 Subject: [PATCH 6/8] manifest: Add new and download per-arch scenarios --- .../dnf/plugins-core/manifest.feature | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/dnf-behave-tests/dnf/plugins-core/manifest.feature b/dnf-behave-tests/dnf/plugins-core/manifest.feature index cbd7d3833..f0046b517 100644 --- a/dnf-behave-tests/dnf/plugins-core/manifest.feature +++ b/dnf-behave-tests/dnf/plugins-core/manifest.feature @@ -473,6 +473,45 @@ Scenario: Generate new multiarch manifest file """ +Scenario: Generate new manifest files for each arch + Given I use repository "security-upgrade-multilib" + And I successfully execute dnf with args "manifest new B-1-1 --archs x86_64 i686 --per-arch" + Then file "/{context.dnf.tempdir}/packages.manifest.x86_64.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: security-upgrade-multilib + baseurl: file:///root/dbox/ci-dnf-stack/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ + packages: + x86_64: + - name: B + repo_id: security-upgrade-multilib + location: x86_64/B-1-1.x86_64.rpm + checksum: sha256:* + size: * + evr: 1-1 + """ + And file "/{context.dnf.tempdir}/packages.manifest.i686.yaml" matches line by line + """ + document: rpm-package-manifest + version: * + data: + repositories: + - id: security-upgrade-multilib + baseurl: file:///root/dbox/ci-dnf-stack/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ + packages: + i686: + - name: B + repo_id: security-upgrade-multilib + location: i686/B-1-1.i686.rpm + checksum: sha256:* + size: * + evr: 1-1 + """ + + Scenario: Download packages from the manifest Given I successfully execute dnf with args "manifest new abcde http-parser" When I execute dnf with args "manifest download" @@ -496,6 +535,16 @@ Scenario: Download multiarch packages from the manifest | {context.dnf.tempdir}/packages.manifest/B-1-1.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/security-upgrade-multilib/x86_64/B-1-1.x86_64.rpm | +Scenario: Download packages from the arch-specific manifest + Given I use repository "security-upgrade-multilib" + And I successfully execute dnf with args "manifest new B-1-1 --archs x86_64 i686 --per-arch" + When I execute dnf with args "manifest download" + Then the exit code is 0 + And file sha256 checksums are following + | Path | sha256 | + | {context.dnf.tempdir}/packages.manifest.x86_64/B-1-1.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/security-upgrade-multilib/x86_64/B-1-1.x86_64.rpm | + + Scenario: Install packages from the manifest Given I successfully execute dnf with args "manifest new abcde http-parser" When I execute dnf with args "manifest install" From 25217b1626e3bbeca02484e394a12c4ece7bd2b7 Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Mon, 24 Mar 2025 15:20:51 +0000 Subject: [PATCH 7/8] manifest: Update test scenarios with multiarch downloads Test downloading packages different than a system basearch --- .../dnf/plugins-core/manifest.feature | 34 +++++++++++-------- .../manifest-multiarch/bar-1.0.ppc64.spec | 14 ++++++++ .../manifest-multiarch/foo-1.0.ppc64.spec | 16 +++++++++ .../specs/manifest-multiarch/waldo-1.0.spec | 16 +++++++++ 4 files changed, 65 insertions(+), 15 deletions(-) create mode 100644 dnf-behave-tests/fixtures/specs/manifest-multiarch/bar-1.0.ppc64.spec create mode 100644 dnf-behave-tests/fixtures/specs/manifest-multiarch/foo-1.0.ppc64.spec create mode 100644 dnf-behave-tests/fixtures/specs/manifest-multiarch/waldo-1.0.spec diff --git a/dnf-behave-tests/dnf/plugins-core/manifest.feature b/dnf-behave-tests/dnf/plugins-core/manifest.feature index f0046b517..bc7957906 100644 --- a/dnf-behave-tests/dnf/plugins-core/manifest.feature +++ b/dnf-behave-tests/dnf/plugins-core/manifest.feature @@ -524,25 +524,29 @@ Scenario: Download packages from the manifest | {context.dnf.tempdir}/packages.manifest/wget-1.19.5-5.fc29.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/dnf-ci-fedora/x86_64/wget-1.19.5-5.fc29.x86_64.rpm | -Scenario: Download multiarch packages from the manifest - Given I use repository "security-upgrade-multilib" - And I successfully execute dnf with args "manifest new B-1-1 --archs x86_64 i686" - When I execute dnf with args "manifest download --archs x86_64 i686" +Scenario: Download multiarch packages from multiarch manifest + Given I use repository "manifest-multiarch" + And I successfully execute dnf with args "manifest new foo --archs x86_64 ppc64" + When I execute dnf with args "manifest download --archs x86_64 ppc64" Then the exit code is 0 And file sha256 checksums are following - | Path | sha256 | - | {context.dnf.tempdir}/packages.manifest/B-1-1.i686.rpm | file://{context.dnf.fixturesdir}/repos/security-upgrade-multilib/i686/B-1-1.i686.rpm | - | {context.dnf.tempdir}/packages.manifest/B-1-1.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/security-upgrade-multilib/x86_64/B-1-1.x86_64.rpm | + | Path | sha256 | + | {context.dnf.tempdir}/packages.manifest/foo-1.0-1.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/manifest-multiarch/x86_64/foo-1.0-1.x86_64.rpm | + | {context.dnf.tempdir}/packages.manifest/foo-1.0-1.ppc64.rpm | file://{context.dnf.fixturesdir}/repos/manifest-multiarch/ppc64/foo-1.0-1.ppc64.rpm | + | {context.dnf.tempdir}/packages.manifest/waldo-1.0-1.noarch.rpm | file://{context.dnf.fixturesdir}/repos/manifest-multiarch/noarch/waldo-1.0-1.noarch.rpm | -Scenario: Download packages from the arch-specific manifest - Given I use repository "security-upgrade-multilib" - And I successfully execute dnf with args "manifest new B-1-1 --archs x86_64 i686 --per-arch" - When I execute dnf with args "manifest download" - Then the exit code is 0 - And file sha256 checksums are following - | Path | sha256 | - | {context.dnf.tempdir}/packages.manifest.x86_64/B-1-1.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/security-upgrade-multilib/x86_64/B-1-1.x86_64.rpm | +Scenario: Download multiarch packages from per-arch manifests + Given I use repository "manifest-multiarch" + And I successfully execute dnf with args "manifest new foo --archs x86_64 ppc64 --per-arch" + And I successfully execute dnf with args "manifest download --archs x86_64" + And I successfully execute dnf with args "manifest download --archs ppc64" + Then file sha256 checksums are following + | Path | sha256 | + | {context.dnf.tempdir}/packages.manifest.x86_64/foo-1.0-1.x86_64.rpm | file://{context.dnf.fixturesdir}/repos/manifest-multiarch/x86_64/foo-1.0-1.x86_64.rpm | + | {context.dnf.tempdir}/packages.manifest.x86_64/waldo-1.0-1.noarch.rpm | file://{context.dnf.fixturesdir}/repos/manifest-multiarch/noarch/waldo-1.0-1.noarch.rpm | + | {context.dnf.tempdir}/packages.manifest.ppc64/foo-1.0-1.ppc64.rpm | file://{context.dnf.fixturesdir}/repos/manifest-multiarch/ppc64/foo-1.0-1.ppc64.rpm | + | {context.dnf.tempdir}/packages.manifest.ppc64/waldo-1.0-1.noarch.rpm | file://{context.dnf.fixturesdir}/repos/manifest-multiarch/noarch/waldo-1.0-1.noarch.rpm | Scenario: Install packages from the manifest diff --git a/dnf-behave-tests/fixtures/specs/manifest-multiarch/bar-1.0.ppc64.spec b/dnf-behave-tests/fixtures/specs/manifest-multiarch/bar-1.0.ppc64.spec new file mode 100644 index 000000000..1ca1fd6c2 --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/manifest-multiarch/bar-1.0.ppc64.spec @@ -0,0 +1,14 @@ +Name: bar +Version: 1.0 +Release: 1 + +License: Public Domain +URL: None +Summary: Dummy + +%description +Dummy. + +%files + +%changelog diff --git a/dnf-behave-tests/fixtures/specs/manifest-multiarch/foo-1.0.ppc64.spec b/dnf-behave-tests/fixtures/specs/manifest-multiarch/foo-1.0.ppc64.spec new file mode 100644 index 000000000..004097654 --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/manifest-multiarch/foo-1.0.ppc64.spec @@ -0,0 +1,16 @@ +Name: foo +Version: 1.0 +Release: 1 + +Requires: waldo + +License: Public Domain +URL: None +Summary: Dummy + +%description +Dummy. + +%files + +%changelog diff --git a/dnf-behave-tests/fixtures/specs/manifest-multiarch/waldo-1.0.spec b/dnf-behave-tests/fixtures/specs/manifest-multiarch/waldo-1.0.spec new file mode 100644 index 000000000..83e779a6b --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/manifest-multiarch/waldo-1.0.spec @@ -0,0 +1,16 @@ +Name: waldo +Version: 1.0 +Release: 1 + +BuildArch: noarch + +License: Public Domain +URL: None +Summary: Dummy + +%description +Dummy. + +%files + +%changelog From d7f4d545ab04b317380a646425a0fe00efd5aa0f Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Wed, 27 Aug 2025 13:07:21 -0400 Subject: [PATCH 8/8] manifest: Fix baseurl paths for use in test container --- dnf-behave-tests/dnf/plugins-core/manifest.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dnf-behave-tests/dnf/plugins-core/manifest.feature b/dnf-behave-tests/dnf/plugins-core/manifest.feature index bc7957906..eb5086e1f 100644 --- a/dnf-behave-tests/dnf/plugins-core/manifest.feature +++ b/dnf-behave-tests/dnf/plugins-core/manifest.feature @@ -454,7 +454,7 @@ Scenario: Generate new multiarch manifest file data: repositories: - id: security-upgrade-multilib - baseurl: file:///root/dbox/ci-dnf-stack/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ + baseurl: file:///opt/ci/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ packages: i686: - name: B @@ -483,7 +483,7 @@ Scenario: Generate new manifest files for each arch data: repositories: - id: security-upgrade-multilib - baseurl: file:///root/dbox/ci-dnf-stack/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ + baseurl: file:///opt/ci/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ packages: x86_64: - name: B @@ -500,7 +500,7 @@ Scenario: Generate new manifest files for each arch data: repositories: - id: security-upgrade-multilib - baseurl: file:///root/dbox/ci-dnf-stack/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ + baseurl: file:///opt/ci/dnf-behave-tests/fixtures/repos/security-upgrade-multilib/ packages: i686: - name: B