From 86a455a1cf52699cabcf0bfa8491c2930afe2ea6 Mon Sep 17 00:00:00 2001 From: Patrick Creech Date: Mon, 27 Nov 2023 12:20:55 -0500 Subject: [PATCH 1/2] Pulp switched to exporting ".tar"s --- bats/fb-katello-content.bats | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bats/fb-katello-content.bats b/bats/fb-katello-content.bats index 53cef58bf..d0acb4f21 100755 --- a/bats/fb-katello-content.bats +++ b/bats/fb-katello-content.bats @@ -126,7 +126,7 @@ setup() { --content-view="${CONTENT_VIEW}" --version="1.0" export_version_id=$(hammer --output csv --no-headers content-view version show --version="1.0" --content-view="${CONTENT_VIEW}" --organization="${ORGANIZATION}" \ --fields=id) - actual_size=$(du -k "$(hammer --output csv --no-headers content-export list --content-view-version-id=$export_version_id --fields="path")"/*.gz | cut -f 1) + actual_size=$(du -k "$(hammer --output csv --no-headers content-export list --content-view-version-id=$export_version_id --fields="path")"/*.tar* | cut -f 1) [ $actual_size -ge 40 ] } @@ -178,7 +178,7 @@ setup() { hammer content-export complete library --organization="${ORGANIZATION}" export_version_id=$(hammer --output csv --no-headers content-view version list --content-view="${LIBRARY}" --organization="${ORGANIZATION}" \ --fields=id --per-page=1 --order="version DESC") - actual_size=$(du -k "$(hammer --output csv --no-headers content-export list --content-view-version-id=$export_version_id --fields="path")"/*.gz | cut -f 1) + actual_size=$(du -k "$(hammer --output csv --no-headers content-export list --content-view-version-id=$export_version_id --fields="path")"/*.tar* | cut -f 1) [ $actual_size -ge 40 ] } @@ -225,7 +225,7 @@ setup() { hammer content-export incremental version --organization="${ORGANIZATION}" \ --content-view="${CONTENT_VIEW}" --id="$export_version_id" - actual_size=$(du -k "$(hammer --output csv --no-headers content-export list --content-view-version-id=$export_version_id --fields="path" --per-page=1)"/*.gz | cut -f 1) + actual_size=$(du -k "$(hammer --output csv --no-headers content-export list --content-view-version-id=$export_version_id --fields="path" --per-page=1)"/*.tar* | cut -f 1) # actual size of export should be less than 14K [ $actual_size -le 87 ] } @@ -236,7 +236,7 @@ setup() { export_version_id=$(hammer --output csv --no-headers content-view version list --content-view="${LIBRARY}" --organization="${ORGANIZATION}" \ --fields=id --per-page=1 --order="version DESC") - actual_size=$(du -k "$(hammer --output csv --no-headers content-export list --content-view-version-id=$export_version_id --fields="path" --per-page=1)"/*.gz | cut -f 1) + actual_size=$(du -k "$(hammer --output csv --no-headers content-export list --content-view-version-id=$export_version_id --fields="path" --per-page=1)"/*.tar* | cut -f 1) [ $actual_size -le 174 ] } From 6b737ec50fc15e8f0ad60a68e0f38d3551d97418 Mon Sep 17 00:00:00 2001 From: Patrick Creech Date: Mon, 27 Nov 2023 12:04:16 -0500 Subject: [PATCH 2/2] Skip import/export tests if pulpcore 3.39 --- bats/fb-katello-content.bats | 20 ++++++++++++++++++++ bats/foreman_helper.bash | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/bats/fb-katello-content.bats b/bats/fb-katello-content.bats index d0acb4f21..ac56e0f5b 100755 --- a/bats/fb-katello-content.bats +++ b/bats/fb-katello-content.bats @@ -122,6 +122,8 @@ setup() { } @test "export content view version" { + tSkipIfPulp339 + hammer content-export complete version --organization="${ORGANIZATION}" \ --content-view="${CONTENT_VIEW}" --version="1.0" export_version_id=$(hammer --output csv --no-headers content-view version show --version="1.0" --content-view="${CONTENT_VIEW}" --organization="${ORGANIZATION}" \ @@ -136,6 +138,8 @@ setup() { } @test "import the exported content view" { + tSkipIfPulp339 + latest_export=$(hammer --output csv --no-headers content-export list --content-view "${CONTENT_VIEW}" --organization "${ORGANIZATION}"\ --content-view-version="1.0" --fields="Id,Path" --per-page=1 --order="id DESC") # 16,,/var/lib/pulp/exports/Test_Organization/Test_CV/1.0/2020-12-11T16-04-08-00-00,Test CV 1.0,6,2020-12-11 16:04:12 UTC,2020-12-11 16:04:12 UTC @@ -164,6 +168,8 @@ setup() { } @test "compare contents of export and import" { + tSkipIfPulp339 + export_version=$(hammer --output csv --no-headers content-view version list --content-view="${CONTENT_VIEW}" --organization="${ORGANIZATION}"\ --per-page=1 --fields="Version" --order="version DESC") hammer --output csv --no-headers content-view version show --content-view="${CONTENT_VIEW}" --organization="${ORGANIZATION}" \ @@ -175,6 +181,8 @@ setup() { } @test "export the library" { + tSkipIfPulp339 + hammer content-export complete library --organization="${ORGANIZATION}" export_version_id=$(hammer --output csv --no-headers content-view version list --content-view="${LIBRARY}" --organization="${ORGANIZATION}" \ --fields=id --per-page=1 --order="version DESC") @@ -184,10 +192,14 @@ setup() { } @test "create org for library import" { + tSkipIfPulp339 + hammer organization create --name="${LIBRARY_IMPORT_ORG}" } @test "import the library to the new organization" { + tSkipIfPulp339 + latest_export=$(hammer --output csv --no-headers content-export list --content-view "${LIBRARY}" --organization "${ORGANIZATION}"\ --fields="Id,Path" --per-page=1 --order="id DESC") export_history_id=$(echo $latest_export | cut -d, -f1) # 16 @@ -203,6 +215,8 @@ setup() { } @test "compare contents of library export and import" { + tSkipIfPulp339 + export_version=$(hammer --output csv --no-headers content-view version list --content-view="${LIBRARY}" --organization="${ORGANIZATION}"\ --per-page=1 --fields="Version" --order="version DESC") hammer --output csv --no-headers content-view version show --content-view="${LIBRARY}" --organization="${ORGANIZATION}" \ @@ -215,11 +229,15 @@ setup() { @test "publish content view again" { + tSkipIfPulp339 + hammer content-view publish --organization="${ORGANIZATION}" \ --name="${CONTENT_VIEW}" } @test "perform an incremental export" { + tSkipIfPulp339 + export_version_id=$(hammer --output csv --no-headers content-view version list --content-view="${CONTENT_VIEW}" --organization="${ORGANIZATION}" \ --fields=id --per-page=1 --order="version DESC") @@ -231,6 +249,8 @@ setup() { } @test "perform an incremental library export" { + tSkipIfPulp339 + hammer content-export incremental library --organization="${ORGANIZATION}" export_version_id=$(hammer --output csv --no-headers content-view version list --content-view="${LIBRARY}" --organization="${ORGANIZATION}" \ diff --git a/bats/foreman_helper.bash b/bats/foreman_helper.bash index 746966749..4423230f5 100644 --- a/bats/foreman_helper.bash +++ b/bats/foreman_helper.bash @@ -28,6 +28,12 @@ tKatelloVersion() { ) | cut -d. -f1-2 } +tSkipIfPulp339() { + if tPackageExists python3.11-pulpcore; then + skip "Skipping on Pulpcore 3.39 until https://github.com/pulp/pulpcore/issues/4777 is fixed" + fi +} + tIsVersionNewer() { GIVEN_VERSION="$1" WANTED_VERSION="$2"