Commit e4f9c83a authored by Giada Landi's avatar Giada Landi
Browse files

Generic 401

parent fc1b943c
Loading
Loading
Loading
Loading
+83 −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_COMMON_BI {
   
   import all from MEC_Common;
   
   
   Test Purpose {
      TP Id "TP_MEC_COMMON_001_NT"         //Negative case 401 Unauthorized - no token
      
      Test objective 
         "Check that a MEC API provider responds with an error when it receives 
         a request without token"
      
      Reference "ETSI GS MEC 009 1.1.1, clause 6.16.1"
              
      Config Id Config_MEC_6
      
      Initial conditions  with {
         the IUT entity being_in idle_state
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a HttpRequest containing
               uri indicating value ACCEPTABLE_URI,
	       "not" authorization
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "401 Unauthorized"
            ; to the MEC_CONSUMER entity
         }
      }       
   }
   
   Test Purpose {
      TP Id "TP_MEC_COMMON_001_WT"         //Negative case 401 Unauthorized - wrong token
      
      Test objective 
         "Check that a MEC API provider responds with an error when it receives 
         a request with a wrong token"
      
      Reference "ETSI GS MEC 009 1.1.1, clause 6.16.1"

      Config Id Config_MEC_6

      Initial conditions  with {
         the IUT entity being_in idle_state
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a HttpRequest containing
               uri indicating value ACCEPTABLE_URI,
               headers set to vHeadersInvalidToken
            ; from the MEC_CONSUMER entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "401 Unauthorized"
            ; to the MEC_CONSUMER entity
         }
      }       
   }
   
     
}
+14 −0
Original line number Original line Diff line number Diff line
@@ -37,6 +37,8 @@ Package MEC_Common {
      - MEPM
      - MEPM
      - AMS_CLIENT
      - AMS_CLIENT
      - AMS_SERVER
      - AMS_SERVER
      - MEC_PROVIDER
      - MEC_CONSUMER
      ;
      ;
      events:
      events:
      - services_running      // services available in the IUT
      - services_running      // services available in the IUT
@@ -86,6 +88,10 @@ Package MEC_Common {
         accept of type STRING
         accept of type STRING
        ;
        ;


      type HttpRequest with
	 uri of type STRING
      ;
 
      type HttpMsg with
      type HttpMsg with
         uri of type  STRING,
         uri of type  STRING,
         headers of type HttpHeaders,
         headers of type HttpHeaders,
@@ -229,6 +235,8 @@ Package MEC_Common {
      Component Type MecPlatformManager with gate p of type myPort;
      Component Type MecPlatformManager with gate p of type myPort;
      Component Type UeAppComponent with gate p of type myPort; 
      Component Type UeAppComponent with gate p of type myPort; 
      Component Type MecSystemComponent with gate p of type myPort;
      Component Type MecSystemComponent with gate p of type myPort;
      Component Type MecGenericProvider with gate p of type myPort;
      Component Type MecGenericConsumer with gate p of type myPort;
      
      
      Test Configuration Config_MEC_1 containing
      Test Configuration Config_MEC_1 containing
         Tester component MEC_App of type MecAppComponent
         Tester component MEC_App of type MecAppComponent
@@ -260,5 +268,11 @@ Package MEC_Common {
         connection between MEO.p and IUT.p
         connection between MEO.p and IUT.p
      ;
      ;


      Test Configuration Config_MEC_6 containing
         Tester component Mec_Consumer of type MecGenericConsumer
         SUT component IUT of type MecGenericProvider
         connection between Mec_Consumer.p and IUT.p
      ;

   }
   }
}
}