Skip to content

Commit

Permalink
RHINENG-10237: add templates to export tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psegedy committed Jun 18, 2024
1 parent 543c19c commit e287a91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions manager/controllers/advisory_systems_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
7 changes: 4 additions & 3 deletions manager/controllers/package_systems_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,[]",
"\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,,0,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])
}

Expand Down
4 changes: 2 additions & 2 deletions manager/controllers/systems_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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])
}

Expand Down

0 comments on commit e287a91

Please sign in to comment.