Skip to content

Commit

Permalink
Merge pull request #4144 from LiilyZhang/zhangl/Issue3433
Browse files Browse the repository at this point in the history
Issue #3433 - MMSinCluster: add e2edev test cases
  • Loading branch information
LiilyZhang authored Sep 17, 2024
2 parents 19bf48b + 467cbba commit 79e6077
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"properties":[{"name":"purpose","value":"k8s-service-mms-testing"}],"constraints":["policy.purpose == k8s-service-mms-testing"]}
27 changes: 27 additions & 0 deletions test/gov/input_files/k8s_deploy/k8s-mms-operator/node_ui.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"serviceOrgid": "[email protected]",
"serviceUrl": "k8s-hello-mms",
"serviceArch": "amd64",
"serviceVersionRange": "[1.0.0,INFINITY)",
"inputs": [
{
"name": "LISTEN_PORT",
"value": "8347"
},
{
"name": "MMS_OBJECT_TYPES",
"value": ["model", "model1", "model2"]
},
{
"name": "SERVICE_TO_START",
"value": "openhorizon/hello-k8s-mms-consumer_amd64:2.0.0"
},
{
"name": "MMS_HELPER_SERVICE_TO_START",
"value": "openhorizon/hello-k8s-mms-helper_amd64:2.0.0"
}
]
}
]

86 changes: 86 additions & 0 deletions test/gov/service_apireg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,50 @@ then
exit 2
fi

cat <<EOF >$KEY_TEST_DIR/svc_k8s_mms.json
{
"label":"MMS cluster service for amd64",
"description":"Cluster Service Test k8s-hello-mms",
"public":true,
"sharable":"multiple",
"url":"k8s-hello-mms",
"version":"$VERS",
"arch":"${ARCH}",
"requiredServices":[
],
"userInput": [
{
"name": "LISTEN_PORT",
"value": "8347"
},
{
"name": "MMS_OBJECT_TYPES",
"value": ["model", "model1", "model2"]
},
{
"name": "SERVICE_TO_START",
"value": "openhorizon/hello-k8s-mms-consumer_amd64:2.0.0"
},
{
"name": "MMS_HELPER_SERVICE_TO_START",
"value": "openhorizon/hello-k8s-mms-helper_amd64:2.0.0"
}
],
"clusterDeployment": {
"operatorYamlArchive": "/root/input_files/k8s_deploy/k8s-mms-operator/k8s-mms-operator.tar.gz"
},
"clusterDeploymentSignature": ""
}
EOF

echo -e "Register k8s-hello-mms $VERS:"
hzn exchange service publish -I -u $E2EDEV_ADMIN_AUTH -o [email protected] -f $KEY_TEST_DIR/svc_k8s_mms.json -k $KEY_TEST_DIR/*private.key -K $KEY_TEST_DIR/*public.pem
if [ $? -ne 0 ]
then
echo -e "hzn exchange service publish failed for k8s-hello-mms."
exit 2
fi


echo -e "Listing services:"
hzn exchange service list -o [email protected]
Expand Down Expand Up @@ -1609,6 +1653,48 @@ echo -e "Register business policy bp_k8s_secret for k8s-hello-secret:"
results "$RES"
fi

read -d '' bpk8smmsdef <<EOF
{
"label": "business policy for k8s-hello-mms",
"description": "Deployment Policy for k8s-hello-mms",
"service": {
"name": "k8s-hello-mms",
"org": "[email protected]",
"arch": "${ARCH}",
"serviceVersions": [
{
"version":"$K8SVERS",
"priority":{},
"upgradePolicy": {}
}
]
},
"properties": [
{
"name": "iame2edev",
"value": "true"
},
{
"name": "NOK8S",
"value": false
},
{
"name": "policy.purpose",
"value": "k8s-service-mms-testing"
}
],
"constraints": [
"purpose == k8s-service-mms-testing"
]
}
EOF

echo -e "Register business policy bp_k8s_mms for k8s-hello-mms service:"

RES=$(echo "$bpk8smmsdef" | curl -sLX POST $CERT_VAR --header 'Content-Type: application/json' --header 'Accept: application/json' -u "$USERDEV_ADMIN_AUTH" --data @- "${EXCH_URL}/orgs/userdev/business/policies/bp_k8s_mms" | jq -r '.')

results "$RES"


# ======================= Service Policies that use top level services ======================
read -d '' nspoldef <<EOF
Expand Down

0 comments on commit 79e6077

Please sign in to comment.