Commit 66f5e281 authored by Giada Landi's avatar Giada Landi
Browse files

Merge branch 'nxw' of https://forge.etsi.org/gitlab/mec/MEC-tests into nxw

parents 88be958b 212b93a2
Loading
Loading
Loading
Loading
+1476 −0

File added.

Preview size limit exceeded, changes collapsed.

+689 −0
Original line number Original line Diff line number Diff line
/*
Copyright (c) ETSI 2018.

This software is subject to copyrights owned by ETSI. Non-exclusive permission
is hereby granted, free of charge, to copy, reproduce and amend this file
under the following conditions: It is provided "as is", without warranty of any
kind, expressed or implied.

ETSI shall never be liable for any claim, damages, or other liability arising
from its use or inability of use.This permission does not apply to any documentation
associated with this file for which ETSI keeps all rights reserved. The present
copyright notice shall be included in all copies of whole or part of this
file and shall not imply any sub-license right.
*/
Package MEC010_2_APP_INSTANCE_LCM {
   
   import all from MEC_Common;
   
   //All APP packages
   
   
   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_001_OK"  // It applies for MM1 and MM3 on MEC10-2                
      
      Test objective 
         "Check that MEC API provider creates a new App Package when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.1.3.1",
              "ETSI GS MEC 010-2 2.0.9, Table 6.2.2.3.2-1",      //CreateAppInstanceRequest
              "ETSI GS MEC 010-2 2.0.9, Table 6.2.2.4.2-1"      //AppInstanceInfo
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity being_in idle_state
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPOST containing 
               uri indicating value "/alcmi/v1/app_instances",
               body containing
                  CreateAppInstanceRequest containing
                     appDId set to APP_D_ID
                  ;
               ;
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "201 Created",
               body containing 
                  AppInstanceInfo containing
                     appInstanceId set to any_value,
                     appDId set to APP_D_ID,
                     appProvider set to any_value,
                     appName set to any_value,
                     appSoftVersion set to any_value,
                     appDVersion set to any_value,
                     appPkgId set to any_value,
                     instantiationState set to NOT_INSTANTIATED,
                     attribute _links
                  ;
               ;
            ; to the MEC_CONSUMER entity
         }
      }       
   }
   

   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_002_OK"
      
      Test objective 
         "Check that MEC API provider retrieves the list of App instances when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.1.3.2",
              "ETSI GS MEC 010-2 2.0.9, Table 6.2.2.4.2-1"      //AppInstanceInfo
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a App_Instance containing
            appInstanceId indicating value APP_INSTANCE_ID;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vGET containing 
               uri indicating value "/alcmi/v1/app_instances"
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",
               body containing 
                  AppInstanceInfoList containing                       // Definition of AppInstanceInfoList is missing. How to handle with arrays?
                     AppInstanceInfo containing
                        appInstanceId set to APP_INSTANCE_ID,
                        appDId set to any_value,
                        appProvider set to any_value,
                        appName set to any_value,
                        appSoftVersion set to any_value,
                        appDVersion set to any_value,
                        appPkgId set to any_value,
                        instantiationState set to any_value,
                        attribute _links
                     ;
                  ;
               ;
            ; to the MEC_CONSUMER entity
         }
      }       
   }
   
   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_003_OK"
      
      Test objective 
         "Check that MEC API provider retrieves an App Package when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.2.3.2",
              "ETSI GS MEC 010-2 2.0.9, Table 6.2.2.4.2-1"      //AppInstanceInfo
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a App_Instance containing
            appInstanceId indicating value APP_INSTANCE_ID;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vGET containing 
               uri indicating value "/alcmi/v1/app_instances/{APP_INSTANCE_ID}"
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",
               body containing 
                  AppInstanceInfo containing
                     appInstanceId set to APP_INSTANCE_ID,
                     appDId set to any_value,
                     appProvider set to any_value,
                     appName set to any_value,
                     appSoftVersion set to any_value,
                     appDVersion set to any_value,
                     appPkgId set to any_value,
                     instantiationState set to any_value,
                     attribute _links
                  ;
               ;
            ; to the MEC_CONSUMER entity
         }
      }       
   }  
   


   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_004_OK"
      
      Test objective 
         "Check that MEC API provider service deletes an App Instance when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.2.3.4"
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a App_Instance containing
            appInstanceId indicating value APP_INSTANCE_ID;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vDELETE containing 
               uri indicating value "/alcmi/v1/app_instances/{APP_INSTANCE_ID}"
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "204 No Content"
            ; to the MEC_CONSUMER entity
         }
      }       
   }  


   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_005_OK"
      
      Test objective 
         "Check that MEC API provider service instantiates an App Instance when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.6.3.1",
                    "ETSI GS MEC 010-2 2.0.9, table 6.2.2.7.2-1" // InstantiateAppRequest
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a App_Instance containing
            appInstanceId indicating value APP_INSTANCE_ID,
            instantiationState indicating value NOT_INSTANTIATED   
         ;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPOST containing 
               uri indicating value "/alcmi/v1/app_instances/{APP_INSTANCE_ID}/instantiate",
               body containing
                  InstantiateAppRequest containing
                     appInstanceId set to APP_INSTANCE_ID,
                     selectedMECHostInfo set to SELECTED_MEC_HOST_INFO
                  ;
               ;
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "202 Accepted",
               headers containing
                  Location set to any_value
               ;
            ; to the MEC_CONSUMER entity
         }
      }       
   }  


   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_006_OK"
      
      Test objective 
         "Check that MEC API provider service terminates an App Instance when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.7.3.1",
                    "ETSI GS MEC 010-2 2.0.9, table 6.2.2.9.2-1" // TerminateAppRequest
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a App_Instance containing
            appInstanceId indicating value APP_INSTANCE_ID,
            instantiationState indicating value INSTANTIATED   
         ;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPOST containing 
               uri indicating value "/alcmi/v1/app_instances/{APP_INSTANCE_ID}/terminate",
               body containing
                  TerminateAppRequest containing
                     terminationType set to TERMINATION_TYPE
                  ;
               ;
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "202 Accepted",
               headers containing
                  Location set to any_value
               ;
            ; to the MEC_CONSUMER entity
         }
      }       
   }  
   
   
   
   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_007_OK"
      
      Test objective 
         "Check that MEC API provider service changes the status of an App Instance from its INITIAL_STATE to a given FINAL_STATE, when requested.
         The following combinations INITIAL_STATE - FINAL_STATE are supported: 
         - STARTED/STOP
         - STOPPED/START"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.8.3.1",
                    "ETSI GS MEC 010-2 2.0.9, table 6.2.2.8.2-1" // OperateAppRequest
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a App_Instance containing
            appInstanceId indicating value APP_INSTANCE_ID,
            instantiationState indicating value INSTANTIATED,
            operationalState indicating value INITIAL_STATE
         ;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPOST containing 
               uri indicating value "/alcmi/v1/app_instances/{APP_INSTANCE_ID}/operate",
               body containing
                  OperateAppRequest containing
                     changeStateTo set to FINAL_STATE
                  ;
               ;
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "202 Accepted",
               headers containing
                  Location set to any_value
               ;
            ; to the MEC_CONSUMER entity
         }
      }       
   }   



   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_008_OK"
      
      Test objective 
         "Check that MEC API provider service retrieves info about LCM Operation Occurrency on App Instances when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.9.1.3.2",
                    "ETSI GS MEC 010-2 2.0.9, table 6.2.2.14.2-1" // AppLcmOpOcc 
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a App_Lcm_Op_Occ containing
            appLcmOpOccId indicating value APP_LCM_OP_OCC_ID
         ;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vGET containing 
               uri indicating value "/alcmi/v1/app_lcm_op_occs"
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",
               body containing
                  AppLcmOpOccList containing
                     AppInstanceLcmOpOcc containing
                        appLcmOpOccId set to APP_LCM_OP_OCC_ID,
                        operationState set to any_value,
                        stateEnteredTime set to any_value,
                        startTime set to any_value,
                        lcmOperation set to any_value,
                        attribute _links containing
                           self set to "/alcmi/v1/app_lcm_op_occs/{APP_LCM_OP_OCC_ID}",
                           appInstance set to any_value
                        ;
                     ;
                  ;
               ;
            ; to the MEC_CONSUMER entity
         }
      }       
   }   


   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_009_OK"
      
      Test objective 
         "Check that MEC API provider service retrieves info about LCM Operation Occurrency on an App Instance when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.10.1.3.2",
                    "ETSI GS MEC 010-2 2.0.9, table 6.2.2.14.2-1" // AppLcmOpOcc 
      
      Config Id Config_MEC_6
      
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a App_Lcm_Op_Occ containing
            appLcmOpOccId indicating value APP_LCM_OP_OCC_ID
         ;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vGET containing 
               uri indicating value "/alcmi/v1/app_lcm_op_occs/{APP_LCM_OP_OCC_ID}"
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",
               body containing
                  AppLcmOpOccList containing
                     AppInstanceLcmOpOcc containing
                        appLcmOpOccId set to APP_LCM_OP_OCC_ID,
                        operationState set to any_value,
                        stateEnteredTime set to any_value,
                        startTime set to any_value,
                        lcmOperation set to any_value,
                        attribute _links containing
                           self set to "/alcmi/v1/app_lcm_op_occs/{APP_LCM_OP_OCC_ID}",
                           appInstance set to any_value
                        ;
                     ;
                  ;
               ;
            ; to the MEC_CONSUMER entity
         }
      }       
   }  


   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_010_OK"
      
      Test objective 
         "Check that MEC API provider service creates a LCM Subscription when requested, where the subscription request can 
          have SUBSCRIPTION_TYPE AppInstanceStateChangeSubscription or AppLcmOpOccStateChangeSubscription"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.3.3.1",
             "ETSI GS MEC 010-2 2.0.9, table 6.2.2.13.2-1",   // AppInstSubscriptionRequest
             "ETSI GS MEC 010-2 2.0.9, table 6.2.2.10.2-1"   // AppInstSubscriptionInfo
                
      Config Id Config_MEC_6
      PICS Selection PIC_APP_LCM_MANAGEMENT 

      Initial conditions  with {
         the IUT entity being_in idle_state
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPOST containing 
               uri indicating value "/alcmi/v1/subscriptions"
               body containing
                  SubscriptionRequest containing
                     callbackUri set to CALLBACK_URI,
                     subscriptionType set to SUBSCRIPTION_TYPE
                  ;
               ;
            ;
            from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "201 Created",
               body containing 
                  SubscriptionInfo containing
                     subscriptionId set to any_value,
                     subscriptionType set to SUBSCRIPTION_TYPE,
                     callbackUri set to CALLBACK_URI,
                     attribute _links
                  ;
               ;
            ;         
            to the MEC_CONSUMER entity
         }
      }
   }
 
 
     
      
   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_011_OK"
      
      Test objective 
         "Check that MEC API provider service sends the list of LCM Subscriptions when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.3.3.2",
             "ETSI GS MEC 010-2 2.0.9, table 6.2.2.13.2-1",   // AppInstSubscriptionRequest
             "ETSI GS MEC 010-2 2.0.9, table 6.2.2.15.2-1",   // AppLcmOpOccSubscriptionRequest
             "ETSI GS MEC 010-2 2.0.9, table 6.2.2.10.2-1",   // AppInstSubscriptionInfo
             "ETSI GS MEC 010-2 2.0.9, table 6.2.2.16.2-1"    // AppLcmOpOccSubscriptionInfo
                
      Config Id Config_MEC_6
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity having a Subscription containing
             subscriptionId indicating value SUBSCRIPTION_ID,
             subscriptionType indicating value SUBSCRIPTION_TYPE,
             callbackUri indicating value URI
         ;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vGET containing 
               uri indicating value "/alcmi/v1/subscriptions"
            ;
            from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",
               body containing
                  SubscriptionInfo containing
	                subscriptionId set to SUBSCRIPTION_ID,
                        subscriptionType set to SUBSCRIPTION_TYPE,
                        callbackUri set to URI,
                        attribute _links
                  ;
               ;
            ;         
            to the MEC_CONSUMER entity
         }
      }
   }
   
   
   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_012_OK"
      
      Test objective 
         "Check that MEC API provider service sends the information about an existing LCM subscription when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.4.3.2",
             "ETSI GS MEC 010-2 2.0.9, table 6.2.2.10.2-1",   // AppInstSubscriptionInfo
             "ETSI GS MEC 010-2 2.0.9, table 6.2.2.16.2-1"    // AppLcmOpOccSubscriptionInfo
                
      Config Id Config_MEC_6
      PICS Selection PIC_APP_LCM_MANAGEMENT 

      Initial conditions  with {
         the IUT entity having a Subscription containing
            subscriptionId indicating value SUBSCRIPTION_ID,
            subscriptionType indicating value SUBSCRIPTION_TYPE,
            callbackUri indicating value URI
         ;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vGET containing 
               uri indicating value "/alcmi/v1/subscriptions/{SUBSCRIPTION_ID}"
            ;
            from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",
               body containing
                  SubscriptionInfo containing
	                 subscriptionId set to SUBSCRIPTION_ID,
                     subscriptionType set to SUBSCRIPTION_TYPE,
                     callbackUri set to URI,
                     attribute _links
                  ;
	           ;
            ;         
            to the MEC_CONSUMER entity
         }
      }
   }
   
   
   
      
   
   Test Purpose {
      TP Id "TP_MEC_GEN_LCM_013_OK"
      
      Test objective 
         "Check that MEC API provider service delete an existing LCM Subscription when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.3.4.3.4"
                
      Config Id Config_MEC_6
      PICS Selection PIC_APP_LCM_MANAGEMENT  

      Initial conditions  with {
         the IUT entity having a Subscription containing
            subscriptionId indicating value SUBSCRIPTION_ID
         ;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vDELETE containing 
               uri indicating value "/alcmi/v1/subscriptions/{SUBSCRIPTION_ID}"
            ;
            from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "204 No Content"
            ;         
            to the MEC_CONSUMER entity
         }
      }
   }



   Test Purpose {

      TP Id "TP_MEC_GEN_INSM_WORKFLOW"
      
      Test objective 
         "Check that MEC API provider instantiates a new application when requested"
      
      Reference "ETSI GS MEC 010-2 2.0.9, clause 7.5.1.3.1"

      Config Id Config_MEC_6
      PICS Selection PIC_APP_LCM_MANAGEMENT

      Initial conditions  with {
         the IUT entity being_in idle_state
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPOST containing 
               uri indicating value "/alcmi/v1/app_instances",
               body containing
                  CreateAppInstanceRequest containing
                     appDId set to APPD_ID
                  ;
               ;
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a vPOST containing
               uri indicating value "/alcmi/v1/app_instances",
               body containing 
                  CreateAppInstanceRequest containing 	//Info model not yet defined
                  	appDId set to APPD_ID
                  ;
               ;
            ; to the MEPM entity
            and
               the IUT entity receives a HTTP_RESPONSE containing
                  status set to "201 Created",      // REST API not yet defined. Response should be 201, but should be checked when REST API is ready 
	              body containing 
	                 INSTANCE_ID_TBD set to INSTANCE_ID
	              ;
	           ;  from the MEPM entity
	        and
	           the IUT entity sends a HTTP_RESPONSE containing
	              status set to "201 Created"
	              body containing
	                 AppInstanceInfo containing
	                    appInstanceId set to any_value,
	                    appDId set to APP_D_ID,
	                    appPkgId set to any_value,
	                    instantiationState set to NOT_INSTANTIATED 
	                    
	                 ;
	              ;
	           ; to the MEC_CONSUMER entity
         } 
      }       
   }
}
+66 −0

File changed and moved.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@ Package MEC010_2_MEO_MM1_LCM_NOTIF {
              "ETSI GS MEC 010-2 2.0.9, table 6.2.2.12.2-1"  // AppInstNotification 
              "ETSI GS MEC 010-2 2.0.9, table 6.2.2.12.2-1"  // AppInstNotification 
              
              


      Config Id Config_MEC_3
      Config Id Config_MEC_6
      PICS Selection PIC_APP_LCM_NOTIFICATIONS 
      PICS Selection PIC_APP_LCM_NOTIFICATIONS 


      Initial conditions  with {
      Initial conditions  with {
+1 −3
Original line number Original line Diff line number Diff line
@@ -765,9 +765,7 @@ Package MEC010_2_MEO_MM1_PKGM_BO_BI {
      PICS Selection PIC_APP_PACKAGE_MANAGEMENT 
      PICS Selection PIC_APP_PACKAGE_MANAGEMENT 


      Initial conditions  with {
      Initial conditions  with {
         the IUT entity having a App_Package containing
         the IUT entity being_in idle_state
            appPkgId indicating value ON_BOARDED_APP_PKG_ID
         ;
      }
      }


      Expected behaviour
      Expected behaviour
Loading