From 14f75f970301dd76ca819139e061f970110ad3cb Mon Sep 17 00:00:00 2001
From: hammad zafar <hammad.zafar@xflowresearch.com>
Date: Wed, 10 Mar 2021 16:56:30 +0500
Subject: [PATCH] fixed Content-Range and Content-Length checks

---
 .../VNFLifecycleManagement-API/VNFStateSnapshot.robot  |  1 +
 .../VnfLcmMntOperationKeywords.robot                   | 10 ++++++++--
 .../environment/variables.txt                          |  2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/SOL003/VNFLifecycleManagement-API/VNFStateSnapshot.robot b/SOL003/VNFLifecycleManagement-API/VNFStateSnapshot.robot
index 985422c3..6556cef2 100644
--- a/SOL003/VNFLifecycleManagement-API/VNFStateSnapshot.robot
+++ b/SOL003/VNFLifecycleManagement-API/VNFStateSnapshot.robot
@@ -53,6 +53,7 @@ GET VNF State Snapshot - Range Request Not Supported
     GET VNF State Snapshot - Range Request
     Check HTTP Response Status Code Is    200
     Check HTTP Content-Type Header Is Set
+    Check HTTP Content-Length Header Is Set
     
 GET VNF State Snapshot - Range Not Satisfiable
     [Documentation]    Test ID: 7.3.1.42.5
diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot
index 13eff74f..0ece9f1a 100644
--- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot
+++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot
@@ -2064,5 +2064,11 @@ Check HTTP Content-Type Header Is Set
 Check HTTP Content-Range Header Is Set
     Log    Check Content-Range HTTP Header
     Should Contain    ${response['headers']}    Content-Range
-    Should Be Equal As Strings    ${response['headers']['Content-Range']}    ${range}
-    Log    Header Content-Range is present
\ No newline at end of file
+    Should Be Equal As Strings    ${response['headers']['Content-Range']}    ${range}/${full_length}
+    Log    Header Content-Range is present
+    
+Check HTTP Content-Length Header Is Set
+    Log    Check Content-Range HTTP Header
+    Should Contain    ${response['headers']}    Content-Length
+    Should Be Equal As Strings    ${response['headers']['Content-Length']}    ${full_length}
+    Log    Header Content-Length is present
\ No newline at end of file
diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt
index bc47d9d4..a179dde9 100644
--- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt
+++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt
@@ -37,7 +37,7 @@ ${CONTENT_TYPE_OCTET}    application/octet-stream
 ${VNFM_RANGE_OK}    1    # If 1 means that Range is supported by the VNFM
 ${range}          bytes=0-1023
 ${erroneousRange}    bytes=10000000-1000000000    # Requesting a out of range number of bytes
-
+${full_length}    2000    #Full size of the content file to be transmitted using partial downloads
 
 ${instantiatedVnfInstanceId}       6fc3539c-e602-4afa-8e13-962fb5a7d81f
 ${notInstantiatedVnfInstanceId}       6fc3539c-e602-4afa-8e13-962fb5a7d81f
-- 
GitLab