@@ -14,51 +14,67 @@ import (
1414)
1515
1616func TestCheckParameters (t * testing.T ) {
17- createServiceImages := func (image string , cocoImage string , hubImage string ) map [string ]string {
17+ createServiceImages := func (
18+ image string , cocoImage string , hubImage string , salineImage string , dbImage string ,
19+ ) map [string ]string {
1820 return map [string ]string {
1921 podman .ServerService : image ,
2022 podman .ServerAttestationService + "@" : cocoImage ,
2123 podman .HubXmlrpcService : hubImage ,
24+ podman .SalineService : salineImage ,
25+ podman .DBService : dbImage ,
2226 }
2327 }
2428 type testData struct {
25- serviceImages map [string ]string
26- hasRemoteImages map [string ]bool
27- expectedImage string
28- expectedCocoImage string
29- expectedHubImage string
30- expectedError string
29+ serviceImages map [string ]string
30+ hasRemoteImages map [string ]bool
31+ expectedImage string
32+ expectedCocoImage string
33+ expectedHubImage string
34+ expectedSalineImage string
35+ expectedDBImage string
36+ expectedError string
3137 }
3238
3339 data := []testData {
3440 {
35- createServiceImages ("registry.suse.com/suse/manager/5.0/x86_64/server:5.0.0" , "" , "" ),
41+ createServiceImages ("registry.suse.com/suse/manager/5.0/x86_64/server:5.0.0" , "" , "" , "" , "" ),
3642 map [string ]bool {},
3743 "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server:latest-ptf-5678" ,
3844 "" ,
3945 "" ,
4046 "" ,
47+ "" ,
48+ "" ,
4149 },
4250 {
4351 createServiceImages (
4452 "registry.suse.com/suse/manager/5.0/x86_64/server:5.0.0" ,
4553 "registry.suse.com/suse/manager/5.0/x86_64/server-attestation:5.0.0" ,
4654 "registry.suse.com/suse/manager/5.0/x86_64/server-hub-xmlrpc-api:5.0.0" ,
55+ "registry.suse.com/suse/manager/5.0/x86_64/server-saline:5.0.0" ,
56+ "registry.suse.com/suse/manager/5.0/x86_64/server-postgresql:5.0.0" ,
4757 ),
4858 map [string ]bool {
4959 "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-attestation:latest-ptf-5678" : true ,
5060 "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-hub-xmlrpc-api:latest-ptf-5678" : true ,
61+ "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-saline:latest-ptf-5678" : true ,
62+ "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-postgresql:latest-ptf-5678" : true ,
5163 },
5264 "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server:latest-ptf-5678" ,
5365 "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-attestation:latest-ptf-5678" ,
5466 "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-hub-xmlrpc-api:latest-ptf-5678" ,
67+ "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-saline:latest-ptf-5678" ,
68+ "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-postgresql:latest-ptf-5678" ,
5569 "" ,
5670 },
5771 {
5872 createServiceImages (
5973 "registry.suse.com/suse/manager/5.0/x86_64/server:5.0.0" ,
6074 "registry.suse.com/suse/manager/5.0/x86_64/server-attestation:5.0.0" ,
6175 "" ,
76+ "" ,
77+ "" ,
6278 ),
6379 map [string ]bool {
6480 "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server:latest-ptf-5678" : true ,
@@ -68,19 +84,25 @@ func TestCheckParameters(t *testing.T) {
6884 "" ,
6985 "" ,
7086 "" ,
87+ "" ,
88+ "" ,
7189 },
7290 {
7391 createServiceImages (
7492 "" ,
7593 "" ,
7694 "registry.suse.com/suse/manager/5.0/x86_64/server-hub-xmlrpc-api:5.0.0" ,
95+ "" ,
96+ "" ,
7797 ),
7898 map [string ]bool {
7999 "registry.suse.com/a/1234/5678/suse/manager/5.0/x86_64/server-hub-xmlrpc-api:latest-ptf-5678" : true ,
80100 },
81101 "" ,
82102 "" ,
83103 "" ,
104+ "" ,
105+ "" ,
84106 "failed to find server image" ,
85107 },
86108 }
@@ -109,5 +131,7 @@ func TestCheckParameters(t *testing.T) {
109131 testutils .AssertEquals (t , testCase + "unexpected image" , test .expectedImage , flags .Image .Name )
110132 testutils .AssertEquals (t , testCase + "unexpected coco image" , test .expectedCocoImage , flags .Coco .Image .Name )
111133 testutils .AssertEquals (t , testCase + "unexpected hub image" , test .expectedHubImage , flags .HubXmlrpc .Image .Name )
134+ testutils .AssertEquals (t , testCase + "unexpected saline image" , test .expectedSalineImage , flags .Saline .Image .Name )
135+ testutils .AssertEquals (t , testCase + "unexpected db image" , test .expectedDBImage , flags .Pgsql .Image .Name )
112136 }
113137}
0 commit comments