From 4b02d990b364d9db996993f5a1579edfeb591544 Mon Sep 17 00:00:00 2001 From: Patrik Segedy Date: Tue, 18 Jun 2024 13:46:27 +0200 Subject: [PATCH] RHINENG-10237: add templates to export tests --- manager/controllers/advisory_systems_export_test.go | 4 ++-- manager/controllers/package_systems_export_test.go | 5 +++-- manager/controllers/systems_export_test.go | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/manager/controllers/advisory_systems_export_test.go b/manager/controllers/advisory_systems_export_test.go index 2ffee2c56..7fe8fe90a 100644 --- a/manager/controllers/advisory_systems_export_test.go +++ b/manager/controllers/advisory_systems_export_test.go @@ -32,11 +32,11 @@ func TestAdvisorySystemsExportCSV(t *testing.T) { assert.Equal(t, 8, len(lines)) assert.Equal(t, "display_name,last_upload,stale,os,rhsm,stale_timestamp,stale_warning_timestamp,culled_timestamp,created,tags,"+ - "groups,baseline_id,baseline_name,status,satellite_managed,built_pkgcache,id", lines[0]) + "groups,baseline_id,baseline_name,template_name,template_id,status,satellite_managed,built_pkgcache,id", lines[0]) assert.Equal(t, "00000000-0000-0000-0000-000000000001,2020-09-22T16:00:00Z,false,RHEL 8.10,8.10,2018-08-26T16:00:00Z,"+ "2018-09-02T16:00:00Z,2018-09-09T16:00:00Z,2018-08-26T16:00:00Z,\"[{'key':'k1','namespace':'ns1','value':'val1'},"+ "{'key':'k2','namespace':'ns1','value':'val2'}]\",\"[{'id':'inventory-group-1','name':'group1'}]\","+ - "1,baseline_1-1,Installable,false,false,00000000-0000-0000-0000-000000000001", + "1,baseline_1-1,temp1-1,1,Installable,false,false,00000000-0000-0000-0000-000000000001", lines[1]) } diff --git a/manager/controllers/package_systems_export_test.go b/manager/controllers/package_systems_export_test.go index 9cea03ee8..81e48a930 100644 --- a/manager/controllers/package_systems_export_test.go +++ b/manager/controllers/package_systems_export_test.go @@ -37,13 +37,14 @@ func TestPackageSystemsExportHandlerCSV(t *testing.T) { assert.Equal(t, 5, len(lines)) assert.Equal(t, "id,display_name,installed_evra,available_evra,updatable,tags,"+ - "baseline_name,baseline_uptodate,satellite_managed,baseline_id,os,rhsm,update_status,groups", lines[0]) + "baseline_name,baseline_uptodate,template_name,template_id,satellite_managed,baseline_id,os,rhsm,"+ + "update_status,groups", lines[0]) assert.Equal(t, "00000000-0000-0000-0000-000000000012,00000000-0000-0000-0000-000000000012,"+ "5.6.13-200.fc31.x86_64,5.10.13-200.fc31.x86_64,true,"+ "\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,false,0,RHEL 8.1,8.1,Installable,[]", lines[1]) assert.Equal(t, "00000000-0000-0000-0000-000000000013,00000000-0000-0000-0000-000000000013,"+ - "5.6.13-200.fc31.x86_64,,false,\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,"+ + "5.6.13-200.fc31.x86_64,,false,\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,,0"+ "false,0,RHEL 8.2,8.2,None,[]", lines[2]) } diff --git a/manager/controllers/systems_export_test.go b/manager/controllers/systems_export_test.go index 230b73fc9..068ad35ab 100644 --- a/manager/controllers/systems_export_test.go +++ b/manager/controllers/systems_export_test.go @@ -18,7 +18,7 @@ var SystemCsvHeader = "id,display_name,os,rhsm,tags,last_evaluation," + "satellite_managed,built_pkgcache,packages_installable,packages_applicable," + "installable_rhsa_count,installable_rhba_count,installable_rhea_count,installable_other_count," + "applicable_rhsa_count,applicable_rhba_count,applicable_rhea_count,applicable_other_count," + - "baseline_id,groups" + "baseline_id,template_name,template_id,groups" func makeRequest(t *testing.T, path string, contentType string) *httptest.ResponseRecorder { core.SetupTest(t) @@ -60,7 +60,7 @@ func TestSystemsExportCSV(t *testing.T) { "\"[{'key':'k1','namespace':'ns1','value':'val1'},{'key':'k2','namespace':'ns1','value':'val2'}]\","+ "2018-09-22T16:00:00Z,2,2,1,0,0,baseline_1-1,"+ "2020-09-22T16:00:00Z,2018-08-26T16:00:00Z,2018-09-02T16:00:00Z,2018-09-09T16:00:00Z,2018-08-26T16:00:00Z,"+ - "false,false,false,0,0,2,2,1,0,2,3,3,3,1,\"[{'id':'inventory-group-1','name':'group1'}]\"", + "false,false,false,0,0,2,2,1,0,2,3,3,3,1,temp1-1,1,\"[{'id':'inventory-group-1','name':'group1'}]\"", lines[1]) }