@@ -106,6 +106,29 @@ func AssertClientVersion(binary string) {
106
106
}
107
107
}
108
108
109
+ func AssertServerVersion (binary string ) {
110
+ var commandResult , unexpectedVersion string
111
+
112
+ switch binary {
113
+ case "opc" :
114
+ commandResult = cmd .MustSucceed ("/tmp/opc" , "version" , "--server" ).Stdout ()
115
+ components := [4 ]string {"Chains version" , "Pipeline version" , "Triggers version" , "Operator version" }
116
+ expectedVersions := [4 ]string {os .Getenv ("CHAINS_VERSION" ), os .Getenv ("PIPELINE_VERSION" ), os .Getenv ("TRIGGERS_VERSION" ), os .Getenv ("OPERATOR_VERSION" )}
117
+ splittedCommandResult := strings .Split (commandResult , "\n " )
118
+ for i := 0 ; i < 4 ; i ++ {
119
+ if strings .Contains (splittedCommandResult [i ], components [i ]) {
120
+ if ! strings .Contains (splittedCommandResult [i ], expectedVersions [i ]) {
121
+ unexpectedVersion = splittedCommandResult [i ]
122
+ testsuit .T .Errorf ("%s has an unexpected version: %s. Expected: %s" , components [i ], unexpectedVersion , expectedVersions [i ])
123
+ }
124
+ }
125
+ }
126
+ default :
127
+ testsuit .T .Errorf ("Unknown binary or client" )
128
+ }
129
+
130
+ }
131
+
109
132
func ValidateQuickstarts () {
110
133
cmd .MustSucceed ("oc" , "get" , "consolequickstart" , "install-app-and-associate-pipeline" ).Stdout ()
111
134
cmd .MustSucceed ("oc" , "get" , "consolequickstart" , "configure-pipeline-metrics" ).Stdout ()
0 commit comments