Commit 1e2a5840 authored by piscione's avatar piscione
Browse files

First version of MEC028 TPs.

parent b75ff04e
Loading
Loading
Loading
Loading
+99 −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 MEC_MEC028_SRV_WAI {
	import all from MEC_Common;
		
		//Query without filter
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_001_OK"
			Test objective
		      "Check that the IUT responds with the list of Access Point"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.3.3.1",
	         "https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/ApInfo"
   
    	Config Id Config_MEC_4
   
      	PICS Selection PIC_SERVICES

      	Initial conditions  with {
        	the IUT entity being_in idle_state
      	}
	// MEC 028, clause 5.2.2
		Expected behaviour
			ensure that {
				when {
					the IUT entity receives
						a vGET containing
							uri indicating value "/wai/v1/queries/ap/ap_information"
						;
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.3.3.1
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "200 OK"
			                body containing
                     			ApInfo containing 
                        			apId containing
                           				macId set to MAC_ID			
                        			;
                     			;
                  			;
						;
					to the Dev_App entity
				}
         	}
		}
		
		//Bad request
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_001_BR"
			Test objective
				"Check that the IUT responds with an error when a request with
				incorrect parameters is sent by a MEC Application"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.3.3.1"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity being_in idle_state
  			}
			// MEC 028, clause 5.2.2
			Expected behaviour
			// 	Invalid filter should trigger an error response.
				ensure that {
				when {
					the IUT entity receives
						a vGET containing
							uri indicating value "/dev_app/v1/app_list/?filter=INVALID_FILTER"
						;
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.3.3.1
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "400 Bad Request"
						;
					to the Dev_App entity
				}
         	}
		}
}
+307 −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 MEC_MEC028_SRV_WAI {
	import all from MEC_Common;
		
	
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_005_OK"
			Test objective
		      "Check that the IUT responds with the list of Subscription"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.1",
	         "https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription"
   
    	Config Id Config_MEC_4
   
      	PICS Selection PIC_SERVICES

      	Initial conditions  with {
        	the IUT entity being_in idle_state
      	}
	
		Expected behaviour
			ensure that {
				when {
					the IUT entity receives
						a vGET containing
							uri indicating value "/wai/v1/subscriptions/{SUBSCRIPTION_ID}"
						;
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.6.3.1
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "200 OK"
			                	body containing
                     				AssocStaSubscription containing 
                     					subscriptionType set to "AssocStaSubscription",
                     					callbackReference set to CALLBACK_URI,
                     					apId containing
                     						macId set to MAC_ID
                     				;		
                     			;
                  			;
						;
					to the Dev_App entity
				}
         	}
		}

		
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_001_NF"
			Test objective
				"Check that the IUT responds with an error when a request for existing subscription with incorrect parameters is sent"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.1"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity being_in idle_state and
         		the IUT entity "not" having a subscriptions containing
            	subscriptionId indicating value NON_EXISTENT_SUBSCRIPTION_ID
         	;
  			}
			
			Expected behaviour
				ensure that {
				when {
					the IUT entity receives
						a vGET containing
							uri indicating value "/wai/v1/subscriptions/{NON_EXISTENT_SUBSCRIPTION_ID}"
						;
					from the Dev_App entity
				}
				then {
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "404 Not found"
						;
					to the Dev_App entity
				}
         	}
		}
		
		
		
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_006_OK"
			Test objective
				"Check that the IUT responds with a Notification Subscription when it is modified"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.2"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity having a
						AssocStaSubscription containing 
                     		subscriptionType set to "AssocStaSubscription",
                     		callbackReference set to CALLBACK_URI,
                     		_links containing
                     			self set to URI_TO_RESOURCE,
                     			apId containing
                     			macId set to MAC_ID
                     			;
                     		;	
						;
  			}
		//MEC 028, clause 5.2.4.3
			Expected behaviour
				ensure that {
				when {
					the IUT entity receives
						a vPUT containing
							uri indicating value "/wai/v1/subscriptions/{SUBSCRIPTION_ID}"
							body containing
                     			AssocStaSubscription containing 
                     					subscriptionType set to "AssocStaSubscription",
                     					callbackReference set to CALLBACK_URI,
                     					_links containing
                     						self set to URI_TO_RESOURCE,
                     					apId containing
                     						macId set to MAC_ID
                     					;
                     				;	
							;
						;	
					;
					from the Dev_App entity
				}
				then {

					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "200 OK"
			                body containing
                     			AssocStaSubscription containing 
                     					subscriptionType set to "AssocStaSubscription",
                     					callbackReference set to CALLBACK_URI,
                     					_links containing
                     						self set to "uri/to/resource",
                     					apId containing
                     						macId set to MAC_ID
                     					;
                     				;	
							;
						;	
					;
					to the Dev_App entity
				}
         	}
		}
		
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_005_BR"
			Test objective
				"Check that the IUT responds with an error when an invalid field is set in the subscription modification request"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.2"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity having a
						AssocStaSubscription containing 
                     		subscriptionType set to "AssocStaSubscription",
                     		callbackReference set to CALLBACK_URI,
                     		_links containing
                     			self set to URI_TO_RESOURCE,
                     			apId containing
                     			macId set to MAC_ID
                     			;
                     		;	
						;
  			}
		//MEC 028, clause 5.2.4.3
			Expected behaviour
			// 	Invalid subscriptionType should trigger an error response.
				ensure that {
				when {
					the IUT entity receives
						a vPUT containing
							uri indicating value "/wai/v1/subscriptions/{SUBSCRIPTION_ID}"
							body containing
                     			AssocStaSubscription containing 
                     					subscriptionType set to "INVALID_VALUE",
                     					callbackReference set to CALLBACK_URI,
                     					_links containing
                     						self set to "uri/to/resource",
                     					apId containing
                     						macId set to MAC_ID
                     					;
                     				;	
							;
						;	
					;
					from the Dev_App entity
				}
				then {
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "400 Bad Request"
					;
					to the Dev_App entity
				}
         	}
		}

		
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_007_OK"
			Test objective
				"Check that the IUT responds with 204 when an existing subscription is correctly deleted"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.5"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity having a
						AssocStaSubscription containing 
                     		subscriptionType set to "AssocStaSubscription",
                     		callbackReference set to CALLBACK_URI,
                     		_links containing
                     			self set to URI_TO_RESOURCE,
                     			apId containing
                     			macId set to MAC_ID
                     			;
                     		;	
						;
  			}
		//MEC 028, clause 5.2.4.4
			Expected behaviour
				ensure that {
				when {
					the IUT entity receives
						a vDELETE containing
							uri indicating value "/wai/v1/subscriptions/{SUBSCRIPTION_ID}"
						;
					from the Dev_App entity
				}
				then {

					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "204 No Content"
						;
					to the Dev_App entity
				}
         	}
		}
		
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_002_NF"
			Test objective
				"Check that the IUT responds with an error when an not existing subscription cannot be deleted"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.5"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity being_in idle_state and
         		the IUT entity "not" having a subscriptions containing
            	subscriptionId indicating value NON_EXISTENT_SUBSCRIPTION_ID
            	;
  			}
		//MEC 028, clause 5.2.4.4
			Expected behaviour
				ensure that {
				when {
					the IUT entity receives
						a vDELETE containing
							uri indicating value "/wai/v1/subscriptions/{NON_EXISTENT_SUBSCRIPTION_ID}"
						;
					from the Dev_App entity
				}
				then {
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "404 Not Found"
						;
					to the Dev_App entity
				}
         	}
		}	
}
 No newline at end of file
+63 −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 MEC_MEC028_SRV_WAI {
	import all from MEC_Common;
		
   Test Purpose {
      TP Id "MEC_MEC028_SRV_WAI_008_OK"
      
      Test objective 
         "Check that the IUT sends a notification about WLAN event notification
         if the MEC service has an associated subscription and the event is generated"
      
      Reference "ETSI GS MEC 028 2.1.1, clause 6.4.2",  
         "https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml"
      Config Id Config_MEC_4
      PICS Selection PIC_NOTIFICATIONS

      Initial conditions  with {
         the IUT entity having a AssocStaSubscription containing 
            subscriptionType indicating value "AssocStaSubscription",
            callbackReference indicating value CALLBACK_URI,
            apId containing 
                  macId set to MAC_ID
               ;
         ;
      }

	// MEC 028, clause 5.2.6
      Expected behaviour
      ensure that {
         when {
            the IUT entity generates a ap_identity_event containing 
               macId set to MAC_ID;
         }
         then {
            the IUT entity sends a vPOST containing
               uri indicating value CALLBACK_URI,
               body containing
                  notificationType indicating value "AssocStaNotification",
                  apId containing
                  	macId set to MAC_ID
               		;	
            	; 
            ;
            to the Dev_App entity
         }
      }
   }
}
+100 −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 MEC_MEC028_SRV_WAI {
	import all from MEC_Common;
		
		//Query without filter
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_002_OK"
			Test objective
		      "Check that the IUT responds with the list of Station Point"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.4.3.1",
	         "https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schema/StaInfo"
   
    	Config Id Config_MEC_4
   
      	PICS Selection PIC_SERVICES

      	Initial conditions  with {
        	the IUT entity being_in idle_state
      	}
	// MEC 028, clause 5.2.3
		Expected behaviour
			ensure that {
				when {
					the IUT entity receives
						a vGET containing
							uri indicating value "/wai/v1/queries/sta/sta_information"
						;
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.4.3.1
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "200 OK"
			                body containing
                     			StaInfo containing 
                        			StaIdentity containing
                           				macId set to MAC_ID			
                        			;
                     			;
                  			;
						;
					to the Dev_App entity
				}
         	}
		}
		
		//Bad request
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_002_BR"
			Test objective
				"Check that the IUT responds with an error when a request with
				 incorrect parameters is sent by a MEC Application"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.4.3.1"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity being_in idle_state
  			}
			// MEC 028, clause 5.2.3
			Expected behaviour
			// 	Invalid filter should trigger an error response.
				ensure that {
				when {
					the IUT entity receives
						a vGET containing
							uri indicating value "/wai/v1/queries/sta/sta_information/?filter=INVALID_EXPRESSION"
						;
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.4.3.1
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "400 Bad Request"
						;
					to the Dev_App entity
				}
         	}
		}
}

+196 −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 MEC_MEC028_SRV_WAI {
	import all from MEC_Common;
		
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_003_OK"
			Test objective
		      "Check that the IUT responds with the requested list of subscription"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.5.3.1",
	         "https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription"
   
    	Config Id Config_MEC_4
   
      	PICS Selection PIC_SERVICES

      	Initial conditions  with {
        	the IUT entity being_in idle_state
      	}
		//MEC 028, clause 5.2.4.1
		Expected behaviour
			ensure that {
				when {
					the IUT entity receives
						a vGET containing
							uri indicating value "/wai/v1/subscriptions/?subscription_type=assoc_sta"
						;
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.5.3.1
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "200 OK"
			                body containing
                     			SubscriptionLinkList containing 
                     				_link containing 
                     					LinkType set to "uri/to/subscription"
                     			;
                  			;
						;
					;	
					to the Dev_App entity
				}
         	}
		}

		
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_003_BR"
			Test objective
				"Check that the IUT responds with an error when
				a request with incorrect parameters is sent"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.5.3.1"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity being_in idle_state
  			}
			//MEC 028, clause 5.2.4.1
			Expected behaviour
			// 	Invalid subscription_type should trigger an error response.
				ensure that {
				when {
					the IUT entity receives
						a vGET containing
							uri indicating value "/wai/v1/subscriptions/?subscription_type=INVALID_VALUE"
						;
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.5.3.1
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "400 Bad Request"
						;
					to the Dev_App entity
				}
         	}
		}
		
		

		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_004_OK"
			Test objective
				"Check that the IUT responds with a Notification Subscription"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.5.3.4"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			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 "/wai/v1/subscriptions"
							body containing
                     			AssocStaSubscription containing
                     				subscriptionType set to "AssocStaSubscription",
                     				callbackReference set to CALLBACK_URI,
                     				apId containing 
                     					macId set to MAC_ID
                     				;
								;
							;
						;		
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.5.3.4
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "201 Created"
			                bbody containing
                     			AssocStaSubscription containing
                     				subscriptionType set to "AssocStaSubscription",
                     				callbackReference set to CALLBACK_URI,
                     				self containing
                     					LinkType set to "/wai/v1/subscriptions/{SUBSCRIPTION_ID}",
                     				apId containing 
                     					macId set to MAC_ID
                     				;
								;
							;
						;		
					;
					to the Dev_App entity
				}
         	}
		}
		
		
		Test Purpose {
			TP Id "MEC_MEC028_SRV_WAI_004_BR"
			Test objective
				"Check that the IUT responds with an error when an invalid Subscription request is sent"
			Reference "ETSI GS MEC 028 2.1.1, clause 7.5.3.4"
   
			Config Id Config_MEC_4
   
			PICS Selection PIC_MEC_SYSTEM and PIC_SERVICES

			Initial conditions  with {
				the IUT entity being_in idle_state
  			}

			Expected behaviour
			// 	Invalid subscriptionType should trigger an error response.
				ensure that {
				when {
					the IUT entity receives
						a vPOST containing
							uri indicating value "/wai/v1/subscriptions"
							body containing
                     			AssocStaSubscription containing
                     				subscriptionType set to "INVALID_VALUE"
							;
						;
					;	
					from the Dev_App entity
				}
				then {
					// MEC 028, clause 7.5.3.4
					the IUT entity sends
						a HTTP_RESPONSE containing
							status_code set to "400 Bad Request"
						;
					to the Dev_App entity
				}
         	}
		}	
}