Updates to ocloud_compliance role 63/15363/1 master
authorChris Wheeler <chwheele@redhat.com>
Fri, 12 Dec 2025 00:48:37 +0000 (00:48 +0000)
committerChris Wheeler <chwheele@redhat.com>
Fri, 12 Dec 2025 00:48:37 +0000 (00:48 +0000)
- Install robotframework-requests
- Vars for O-Cloud notification API tests
- Always stop/remove mocksmo container

Change-Id: I1315e145ac710e72036a030a73bdeb2d88168129
Signed-Off-By: Chris Wheeler <chwheele@redhat.com>
Issue-Id: INF-500

okd/README.md
okd/roles/ocloud_compliance/defaults/main.yml
okd/roles/ocloud_compliance/tasks/main.yml
okd/roles/ocloud_compliance/templates/test_configs.yaml.j2

index 371a446..d6129a5 100644 (file)
@@ -426,11 +426,20 @@ A playbook is provided to automate execution of O2 IMS compliance tests from the
 - ocloud_kubeconfig: path of the kubeconfig for the cluster hosting the O2 API server
 - ocloud_compliance_resource_type: name of a resource type associated with the target O-Cloud
 - ocloud_compliance_resource_desc_substring: substring of a resource description associated with the target O-Cloud
+- ocloud_compliance_notification_endpoint: endpoint of the O-Cloud event notification consumer
+- ocloud_compliance_notification_resource_address: resource address of O-Cloud event notification subscription
+- ocloud_compliance_notification_publisher_endpoint: endpoint of the O-Cloud event notification publisher
 
 For example:
 
 ```
-ansible-playbook -i inventory playbooks/ocloud_compliance.yml -e ocloud_kubeconfig=$KUBECONFIG -e ocloud_compliance_resource_type=pserver -e ocloud_compliance_resource_desc_substring=pserver
+ansible-playbook -i inventory playbooks/ocloud_compliance.yml \
+  -e ocloud_kubeconfig=$KUBECONFIG \
+  -e ocloud_compliance_resource_type="HPE/ProLiant DL360 Gen10 Plus (P28948-B21)" \
+  -e ocloud_compliance_resource_desc_substring="DL360" \
+  -e ocloud_compliance_notification_endpoint=http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043/event \
+  -e ocloud_compliance_notification_resource_address=/cluster/node/sno-du-1.example.com/sync/sync-status/sync-state \
+  -e ocloud_compliance_notification_publisher_endpoint=http://ptp-event-publisher-service-sno-du-1.openshift-ptp.svc.cluster.local:9043/api/ocloudNotifications/v2/subscriptions
 ```
 
 ## Sample Workload Deployment
index 768de90..65fb3b7 100644 (file)
@@ -14,3 +14,6 @@ ocloud_compliance_ssh_password: robot
 ocloud_compliance_smo_host: "{{ ansible_default_ipv4['address'] }}"
 ocloud_compliance_smo_port: 1080
 ocloud_compliance_smo_protocol: https
+ocloud_compliance_notification_endpoint: ~
+ocloud_compliance_notification_resource_address: ~
+ocloud_compliance_notification_publisher_endpoint: ~
index 95d530a..cbe2282 100644 (file)
@@ -16,6 +16,7 @@
     name:
       - robotframework
       - RESTinstance
+      - robotframework-requests
       - robotframework-sshlibrary
     virtualenv: "{{ ocloud_compliance_staging_dir['path'] }}/venv"
 
@@ -30,7 +31,7 @@
 - name: Get oran-o2ims Inventory
   kubernetes.core.k8s_info:
     name: default
-    api_version: o2ims.oran.openshift.io/v1alpha1
+    api_version: ocloud.openshift.io/v1alpha1
     kind: Inventory
     namespace: oran-o2ims
     kubeconfig: "{{ ocloud_kubeconfig }}"
@@ -50,7 +51,7 @@
     register: o2ims_ocloud
 
   - set_fact:
-      ocloud_compliance_ocloud_id: "{{ o2ims_ocloud['json']['globalCloudId'] }}"
+      ocloud_compliance_ocloud_id: "{{ o2ims_ocloud['json']['globalcloudId'] }}"
   when: not ocloud_compliance_ocloud_id
 
 - name: Set ocloud_compliance_location_id
     src: "test_configs.yaml.j2"
     dest: "{{ ocloud_compliance_staging_dir['path'] }}/git/test_scripts/O2IMS_Compliance_Test/test_configs.yaml"
 
-- name: Execute compliance tests
-  ansible.builtin.shell:
-    cmd: "{{ ocloud_compliance_staging_dir['path'] }}/venv/bin/robot -L debug -d {{ ocloud_compliance_staging_dir['path'] }}/reports ./o2ims_compliance"
-    chdir: "{{ ocloud_compliance_staging_dir['path'] }}/git/test_scripts/O2IMS_Compliance_Test"
-
-- name: Stop mock SMO container
-  containers.podman.podman_container:
-    name: "mocksmo"
-    state: stopped
+- block:
+  - name: Execute compliance tests
+    ansible.builtin.shell:
+      cmd: "{{ ocloud_compliance_staging_dir['path'] }}/venv/bin/robot -L debug -d {{ ocloud_compliance_staging_dir['path'] }}/reports ./o2ims_compliance"
+      chdir: "{{ ocloud_compliance_staging_dir['path'] }}/git/test_scripts/O2IMS_Compliance_Test"
+  always:
+  - name: Stop mock SMO container
+    containers.podman.podman_container:
+      name: "mocksmo"
+      state: stopped
index 6bb4a2a..d20e5e9 100644 (file)
@@ -12,13 +12,17 @@ ocloud:
     g_ocloud_id: {{ ocloud_compliance_ocloud_id }}
     smo_token_data: {{ ocloud_token }}
     deploymentmanager_name: {{ ocloud_compliance_deployment_manager }}
-    resourcetype_name: {{ ocloud_compliance_resource_type }}
+    resourcetype_name: '{{ ocloud_compliance_resource_type | quote | urlencode }}'
     resource_description_substring: {{ ocloud_compliance_resource_desc_substring }}
-
+    expect_callback_verify: True
     api:
       host: {{ ocloud_compliance_o2ims_host }}
       node_port: {{ ocloud_compliance_o2ims_port }}
       protocol: {{ ocloud_compliance_o2ims_protocol }}
+  oran_o2_notification:
+    endpoint_uri: {{ ocloud_compliance_notification_endpoint }}
+    resource_address: {{ ocloud_compliance_notification_resource_address }}
+    publisher_endpoint: {{ ocloud_compliance_notification_publisher_endpoint }}
 #smo mock server ip and callback endpoints
 smo:
   service:
@@ -32,4 +36,3 @@ smo:
     path: /mock_smo/v1/o2ims_inventory_observer
   o2ims_alarm_observer:
     path: /mock_smo/v1/o2ims_alarm_observer
-