Commit 29373205 authored by Gabriele Scivoletto's avatar Gabriele Scivoletto
Browse files

Test Purposes for IoTPlatform

parent ddee38f2
Loading
Loading
Loading
Loading
+391 −0
Original line number Diff line number Diff line
/*
Copyright (c) ETSI 2018-2021.
Released under BSD 3-clause license. For more information visit https://forge.etsi.org/legal-matters
*/

Package MEC_MEC033_MEX_IOTS_IOTPLAT {
	
	import all from MEC_Common;
	
	Test Purpose {
		TP Id "TP_MEC_MEC033_IOTS_IOTPLAT_OK_01"
		
		Test objective
        	"Check that the IUT responds with the list of registered IoT platforms
         	when queried by a Service Consumer"
         
		Reference "ETSI GS MEC 033 V3.1.1, clause 7.5.3.1"
         
		Config Id Config_MEC_6
         
		PICS Selection PIC_MEC_PLAT and PIC_SERVICES
         
		Initial conditions  with {
			the IUT entity being_in idle_state and
			the MEC_PROVIDER entity having a IoTPlatformInfo containing
				iotPlatformId indicating value IOT_PLATFORM_ID,
				userTransportInfo indicating value USER_TRANSPORT_INFO,
				enabled indicating value BOOLEAN_VALUE
			;
		}
         
		// MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo
		Expected behaviour
			ensure that {
				when {
					the IUT entity receives a vGET containing
					uri indicating value "/iots/v1/registered_iot_platforms"
					;
					from the MEC_CONSUMER entity
				}
	            then {
	               // MEC 033 Clause 7.5.3.1
	               the IUT entity sends a HTTP_RESPONSE containing
	                  status_code set to "200 OK"
	                  body containing
	                     arrayOfIoTPlatformInfo containing
		                     IoTPlatformInfo containing
					            iotPlatformId indicating value IOT_PLATFORM_ID,
					            userTransportInfo indicating value USER_TRANSPORT_INFO,
					            enabled indicating value BOOLEAN_VALUE 
	                  			;
	               			;
	               		;
	               ;
	               to the MEC_CONSUMER entity
	            }
	         }

	}
	
	
	Test Purpose {
		TP Id "TP_MEC_MEC033_IOTS_IOTPLAT_OK_02"
		
		Test objective
	        "Check that the IUT registers the information of a new IoT platform
	        when requested by a Service Consumer"
	        
	    Reference "ETSI GS MEC 033 V3.1.1, clause 7.5.3.4"
	    
	    Config Id Config_MEC_6
	    
	    PICS Selection PIC_MEC_PLAT and PIC_SERVICES
	    
		Initial conditions  with {
			the IUT entity being_in idle_state
		}
		
		// MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo
		Expected behaviour
         ensure that {
            when {
               the IUT entity receives a vPOST containing
                  uri indicating value "/iots/v1/registered_iot_platforms"
                  body containing
                     IotPlatformInfo containing
				            iotPlatformId indicating value IOT_PLATFORM_ID,
				            userTransportInfo indicating value USER_TRANSPORT_INFO,
				            enabled indicating value BOOLEAN_VALUE
                  			;
               		;
               ;
               from the MEC_CONSUMER entity
            }
            then {
               // MEC 033 Clause 7.3.3.4
               the IUT entity sends a HTTP_RESPONSE containing
                  status_code set to "201 Created",
                  Location set to LOCATION,
                  body containing
                     IotPlatformInfo containing
				            iotPlatformId indicating value IOT_PLATFORM_ID,
				            userTransportInfo indicating value USER_TRANSPORT_INFO,
				            enabled indicating value BOOLEAN_VALUE 
                  			;
               			;
               		;
               to the MEC_CONSUMER entity
            }
         }		
			
	}
	
	Test Purpose {
      TP Id "TP_MEC_MEC033_IOTS_IOTPLAT_OK_03"

      Test objective
        "Check that the IUT returns the IoT platform information
         when requested by Service Consumer specifying the platform identifier"

      Reference "ETSI GS MEC 033 V3.1.1, clause 7.5.3.1"

      Config Id Config_MEC_6

      PICS Selection PIC_MEC_PLAT and PIC_SERVICES

      Initial conditions  with {
         the IUT entity being_in idle_state and
         the MEC_PROVIDER entity having a IotPlatformInfo containing
            iotPlatformId indicating value IOT_PLATFORM_ID,
            userTransportInfo indicating value USER_TRANSPORT_INFO,
            enabled indicating value BOOLEAN_VALUE
         ;
         
      }

      // MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo
      Expected behaviour
         ensure that {
            when {
               the IUT entity receives a vGET containing
                  uri indicating value "/iots/v1/registered_iot_platforms/{registeredIotPlatformId}"
                  ;
               from the MEC_CONSUMER entity
            }
            then {
               // MEC 033 Clause 7.5.3.1
               the IUT entity sends a HTTP_RESPONSE containing
                  status_code set to "200 OK",
                  body containing
                     IotPlatformInfo containing
			            iotPlatformId indicating value IOT_PLATFORM_ID,
			            userTransportInfo indicating value USER_TRANSPORT_INFO,
			            enabled indicating value BOOLEAN_VALUE
              			;
           			;
           		;
               to the MEC_CONSUMER entity
            }
         }
   }
   
   Test Purpose {
      TP Id "TP_MEC_MEC033_IOTS_IOTPLAT_NF_03"

      Test objective
        "Check that the IUT returns error
         when Service Consumer request to retrieve a not registered IoT platform"

      Reference "ETSI GS MEC 033 V3.1.1, clause 7.5.3.1"

      Config Id Config_MEC_6

      PICS Selection PIC_MEC_PLAT and PIC_SERVICES

      Initial conditions  with {
         the IUT entity being_in idle_state and
         the MEC_PROVIDER entity having a IotPlatformInfo containing
            iotPlatformId indicating value IOT_PLATFORM_ID,
            userTransportInfo indicating value USER_TRANSPORT_INFO,
            enabled indicating value BOOLEAN_VALUE
         ;
      }

      // MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo
      Expected behaviour
         ensure that {
            when {
               the IUT entity receives a vGET containing
                  uri indicating value "/iots/v1/registered_iot_platforms/{registeredIotPlatformId}"
                  ;
               from the MEC_CONSUMER entity
            }
            then {
               // MEC 033 Clause 7.5.3.1
               the IUT entity sends a HTTP_RESPONSE containing
                  status_code set to "404 Not Found"
               		;
               to the MEC_CONSUMER entity
            }
         }
   }
   
   Test Purpose {
	 TP Id "TP_MEC_MEC033_IOTS_IOTPLAT_OK_04"

	
	      Test objective
	        "Check that the IUT updates the information about a registered IOT platform
	        when requested by a Service Consumer"
	
	      Reference "ETSI GS MEC 033 V3.1.1, clause 7.5.3.2"
	
	      Config Id Config_MEC_6
	
	      PICS Selection PIC_MEC_PLAT and PIC_SERVICES
	
	      Initial conditions  with {
	         the IUT entity being_in idle_state and
	         the MEC_PROVIDER entity having a IotPlatformInfo containing
	            iotPlatformId indicating value IOT_PLATFORM_ID,
	            userTransportInfo indicating value USER_TRANSPORT_INFO,
	            enabled indicating value BOOLEAN_VALUE
	         ;
	      }

	
	      // MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo
	      Expected behaviour
	         ensure that {
	            when {
	               the IUT entity receives a vPUT containing
	                  uri indicating value "/iots/v1/registered_iot_platforms/{registeredIotPlatformId}"
		                  body containing
		                     IotPlatformInfo containing //Updating TrafficRuleDescriptor and the requestedIoTPlatformId associated with
						            iotPlatformId indicating value IOT_PLATFORM_ID,
						            userTranspostInfo indicating value USER_TRANSPORT_INFO,
						            enabled indicating value BOOLEAN_VALUE		               			
		               		;
		            	;
		           ;
	               from the MEC_CONSUMER entity
	            }
	            then {
	               // MEC 033 Clause 7.5.3.2
	               the IUT entity sends a HTTP_RESPONSE containing
	                  status_code set to "200 OK",
	                  body containing
		                     IotPlatformInfo containing
						            iotPlatformId indicating value IOT_PLATFORM_ID,
						            userTranspostInfo indicating value USER_TRANSPORT_INFO,
						            enabled indicating value BOOLEAN_VALUE			             
	               			;
	               		;
	            	;
	               to the MEC_CONSUMER entity
	            }
	         }
	   }
	
	Test Purpose {
	 TP Id "TP_MEC_MEC033_IOTS_IOTPLAT_NF_04"
	
	      Test objective
	        "Check that the IUT returns an error
	        when a Service Consumer requests to update a not registered IoT platform"
	
	      Reference "ETSI GS MEC 033 V3.1.1, clause 7.5.3.2"
	
	      Config Id Config_MEC_6
	
	      PICS Selection PIC_MEC_PLAT and PIC_SERVICES
	
	      Initial conditions  with {
	         the IUT entity being_in idle_state and
	         the MEC_PROVIDER entity having a IotPlatformInfo containing
	            iotPlatformId indicating value IOT_PLATFORM_ID,
	            userTransportInfo indicating value USER_TRANSPORT_INFO,
	            enabled indicating value BOOLEAN_VALUE
	         ;
	      }

	
	      // MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo
	      Expected behaviour
	         ensure that {
	            when {
	               the IUT entity receives a vPUT containing
	                  uri indicating value "/iots/v1/registered_iot_platforms/{registeredIotPlatformId}"
		                  body containing
		                     IotPlatformInfo containing 
						            iotPlatformId indicating value IOT_PLATFORM_ID,
						            userTranspostInfo indicating value USER_TRANSPORT_INFO,
						            enabled indicating value BOOLEAN_VALUE		               			
		               		;
		            	;
		           ;
	               from the MEC_CONSUMER entity
	            }
	            then {
	               // MEC 033 Clause 7.5.3.2
	               the IUT entity sends a HTTP_RESPONSE containing
	                  status_code set to "404 Not Found";
	               to the MEC_CONSUMER entity
	            }
	         }
	   }
	   
	   Test Purpose {
	      TP Id "TP_MEC_MEC033_IOTS_IOTPLAT_OK_05"
	
	      Test objective
	        "Check that the IUT deregisters an IoT platform information
	        when requested by a Service Consumer specifying the IoT registered platform identifier"
	
	      Reference "ETSI GS MEC 033 V3.1.1, clause 7.5.3.5"
	
	      Config Id Config_MEC_6
	
	      PICS Selection PIC_MEC_PLAT and PIC_SERVICES
	
	      Initial conditions  with {
	         the IUT entity being_in idle_state and
	         the MEC_PROVIDER entity having a IotPlatformInfo containing
	            iotPlatformId indicating value IOT_PLATFORM_ID,
	            userTransportInfo indicating value USER_TRANSPORT_INFO,
	            enabled indicating value BOOLEAN_VALUE
	         ;
	      }
	
	      // MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo
	      Expected behaviour
	         ensure that {
	            when {
	               the IUT entity receives a vDELETE containing
	                  uri indicating value "/iots/v1/registered_iot_platforms/{registeredIotPlatformId}"
	                  ;
	               from the MEC_CONSUMER entity
	            }
	            then {
	               // MEC 033 Clause 7.5.3.5
	               the IUT entity sends a HTTP_RESPONSE containing
	                  status_code set to "204 No Content"
	                  ;
	               to the MEC_CONSUMER entity
	            }
	         }
	   }
	   
	   
   Test Purpose {
      TP Id "TP_MEC_MEC033_IOTS_IOTPLAT_NF_05"

      Test objective
        "Check that the IUT returns an error
        when requested by a Service Consumer using incorrect parameters"

      Reference "ETSI GS MEC 033 V3.1.1, clause 7.5.3.5"

      Config Id Config_MEC_6

      PICS Selection PIC_MEC_PLAT and PIC_SERVICES

      Initial conditions  with {
         the IUT entity being_in idle_state and
         the MEC_PROVIDER entity having a IotPlatformInfo containing
            iotPlatformId indicating value IOT_PLATFORM_ID,
            userTransportInfo indicating value USER_TRANSPORT_INFO,
            enabled indicating value BOOLEAN_VALUE
         ;
      }
      // MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo
      Expected behaviour
         ensure that {
            when {
               the IUT entity receives a vDELETE containing
                  uri indicating value "/iots/v1/registered_iot_platforms/{registeredIotPlatformId}"
                  ;
               from the MEC_CONSUMER entity
            }
            then {
               // MEC 033 Clause 7.5.3.5
               the IUT entity sends a HTTP_RESPONSE containing
                  status_code set to "404 Not found"
                  ;
               to the MEC_CONSUMER entity
            }
         }
   }

}
 No newline at end of file