From 9928753a7963a5b80cffebc451f23d49d03262a5 Mon Sep 17 00:00:00 2001
From: aureliano sinatra <sinaure@gmail.com>
Date: Mon, 16 Sep 2019 12:01:11 +0200
Subject: [PATCH] FaultManagementSOL003R1

---
 .../VNFFaultManagement-API/Subscriptions.robot |  8 ++++----
 .../FaultManagement-APIKeyword.robot           |  4 +++-
 .../IndividualSubscription.robot               |  7 ++-----
 .../VNFFaultManagement-API/Subscriptions.robot | 18 ++++++++----------
 4 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/SOL002/VNFFaultManagement-API/Subscriptions.robot b/SOL002/VNFFaultManagement-API/Subscriptions.robot
index 073ca380..32b6ea6b 100644
--- a/SOL002/VNFFaultManagement-API/Subscriptions.robot
+++ b/SOL002/VNFFaultManagement-API/Subscriptions.robot
@@ -14,7 +14,7 @@ Create a new subscription
     ...    Reference: section 7.4.5.3.1 - SOL002 v2.4.1
     ...    Config ID: Config_prod_VNFM
     ...    Applicability: 
-    ...    Post-Conditions: 
+    ...    Post-Conditions: subscription is created
     Post Create subscription
     Check HTTP Response Status Code Is    201
     Check HTTP Response Body Json Schema Is    FmSubscription
@@ -27,7 +27,7 @@ Create a new Subscription - DUPLICATION
     ...    Reference: section 7.4.5.3.1 - SOL002 v2.4.1
     ...    Config ID: Config_prod_VNFM
     ...    Applicability: the VNFM does not allow creation of a subscription resource if another subscription resource with the same filter and callbackUri already exists
-    ...    Post-Conditions: 
+    ...    Post-Conditions: duplicated subscription is created
     Post Create subscription - DUPLICATION
     Check HTTP Response Status Code Is    201
     Check HTTP Response Body Json Schema Is    FmSubscription
@@ -40,7 +40,7 @@ Create a new Subscription - NO-DUPLICATION
     ...    Reference: section 7.4.5.3.1 - SOL002 v2.4.1
     ...    Config ID: Config_prod_VNFM
     ...    Applicability: the VNFM does not allow creation of a duplicate subscription resource 
-    ...    Post-Conditions:
+    ...    Post-Conditions: duplicated subscription is not created
     Post Create subscription - DUPLICATION
     Check HTTP Response Status Code Is    303
 
@@ -52,7 +52,7 @@ GET Subscriptions
     ...    Reference: section 7.4.5.3.2 - SOL002 v2.4.1
     ...    Config ID: Config_prod_VNFM
     ...    Applicability:  
-    ...    Post-Conditions: 
+    ...    Post-Conditions: subscription is not deleted
     Get subscriptions
     Check HTTP Response Status Code Is    200
     Check HTTP Response Body Json Schema Is   FmSubscriptions 
diff --git a/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot b/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot
index 3f4eda70..42fdbe4c 100644
--- a/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot
+++ b/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot
@@ -12,7 +12,9 @@ Library    Process
 ${original_etag}    1234
 
 *** Keywords ***
-
+Check Operation Occurrence Id
+    ${opOccId}=    Get Value From Json    ${response.headers}    $..Location
+    Should Not Be Empty    ${opOccId}
 Check Postcondition VNF fault management alarms Exists
     Log    Checking that alarms exists
     GET Fault Management Alarms
diff --git a/SOL003/VNFFaultManagement-API/IndividualSubscription.robot b/SOL003/VNFFaultManagement-API/IndividualSubscription.robot
index 2e074fb9..2c5d51ae 100644
--- a/SOL003/VNFFaultManagement-API/IndividualSubscription.robot
+++ b/SOL003/VNFFaultManagement-API/IndividualSubscription.robot
@@ -4,9 +4,6 @@ Resource    FaultManagement-APIKeyword.robot
 Library    JSONLibrary
 Library    JSONSchemaLibrary    schemas/
 Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    
-Documentation    This resource represents an individual subscription for VNF alarms. 
-...    The client can use this resource to read and to terminate a subscription to notifications related to VNF fault management.
-Suite Setup    Check Individual Subscription existance
 
 *** Test Cases ***
 Post Individual Subscription - Method not implemented
@@ -17,7 +14,7 @@ Post Individual Subscription - Method not implemented
     ...    Reference: section 7.4.5.3.1 - SOL003 v2.4.1
     ...    Config ID: Config_prod_VNFM
     ...    Applicability:  none
-    ...    Post-Conditions:  none
+    ...    Post-Conditions:  subscription is not created
     POST Individual Subscription
     Check HTTP Response Status Code Is    405
 
@@ -66,7 +63,7 @@ DELETE an individual subscription
     ...    Reference: section 7.4.5.3.5 - SOL003 v2.4.1
     ...    Config ID: Config_prod_VNFM
     ...    Applicability:  none
-    ...    Post-Conditions:  none
+    ...    Post-Conditions:  subscription is not deleted
     DELETE Individual Subscription
     Check HTTP Response Status Code Is    204
     Check Individual Subscription deleted
diff --git a/SOL003/VNFFaultManagement-API/Subscriptions.robot b/SOL003/VNFFaultManagement-API/Subscriptions.robot
index 9e2f0c62..a7b874a4 100644
--- a/SOL003/VNFFaultManagement-API/Subscriptions.robot
+++ b/SOL003/VNFFaultManagement-API/Subscriptions.robot
@@ -16,10 +16,10 @@ Create a new Fault Management alarm subscription
     ...    Reference: section 7.4.4.3.1 - SOL003 v2.4.1
     ...    Config ID:   Config_prod_VNFM
     ...    Applicability: none
-    ...    Post-Conditions: none
+    ...    Post-Conditions: subscription is created
     POST Subscription
     Check HTTP Response Status Code Is    201
-    Check HTTP Response Header Contains    Location
+    Check Operation Occurrence Id
     Check HTTP Response Body Json Schema Is  FmSubscription
   
 
@@ -31,11 +31,10 @@ Create a new alarm subscription - DUPLICATION
     ...    Reference: section 7.4.4.3.1 - SOL003 v2.4.1
     ...    Config ID:   Config_prod_VNFM
     ...    Applicability: the NFVO allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists
-    ...    Post-Conditions: none
-    Depends On Test    Create a new subscription
+    ...    Post-Conditions: duplicated subscription is created
     POST Subscription Duplication permitted
     Check HTTP Response Status Code Is    201
-    Check HTTP Response Header Contains    Location
+    Check Operation Occurrence Id
     Check HTTP Response Body Json Schema Is  FmSubscription
 
 Create a new alarm subscription - NO DUPLICATION
@@ -46,11 +45,10 @@ Create a new alarm subscription - NO DUPLICATION
     ...    Reference: section 7.4.4.3.1 - SOL003 v2.4.1
     ...    Config ID:   Config_prod_VNFM
     ...    Applicability: the NFVO decides to not create a duplicate subscription resource 
-    ...    Post-Conditions: none
-    Depends On Test    Create a new subscription
+    ...    Post-Conditions: duplicated subscription is not created
     POST Subscription Duplication not permitted
     Check HTTP Response Status Code Is    303
-    Check HTTP Response Header Contains    Location
+    Check Operation Occurrence Id
     Check HTTP Response Body Json Schema Is  FmSubscription
 
 Retrieve a list of alarm subscriptions
@@ -118,12 +116,12 @@ PATCH subscriptions - Method not implemented
 
 DELETE subscriptions - Method not implemented
     [Documentation]    Test ID: 7.3.5.3.9
-    ...    Test title:DELETE subscriptions - Method not implemented
+    ...    Test title: DELETE subscriptions - Method not implemented
     ...    Test objective: The objective is to test that DELETE method is not allowed to for Fault management subscriptions on VNF  
     ...    Pre-conditions: none 
     ...    Reference: section 7.4.4.3.5 - SOL003 v2.4.1
     ...    Config ID:  Config_prod_VNFM
     ...    Applicability: none
-    ...    Post-Conditions: none
+    ...    Post-Conditions: subscription is not deleted
     DELETE Subscriptions
     Check HTTP Response Status Code Is    405
\ No newline at end of file
-- 
GitLab