Commit 254020ae authored by Elian Kraja's avatar Elian Kraja
Browse files

Fixing MM1 and MM3 file structure

parent 95feef6c
Loading
Loading
Loading
Loading
+0 −208
Original line number 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_MEO_MM1_PKGM_BO_BI {
   
   import all from MEC_Common;
   
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_001_NEG_A"         //Negative case 400 Bad request
      
      Test objective 
         "Check that MEO responds with an error when it receives 
         a malformed request for creating a new App Package"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.1.3.1",
              "ETSI GS MEC 010-2 1.2.2, Table 6.2.3.2.2-1"      //AppPkg
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_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 "/apmi/v1/app_packages",
               body containing
                  AppPkg containing
                     "not" appPkgName                  //mandatory attribute
                  ;
               ;
            ; from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "400 Bad Request"
            ; to the MEC_OSS entity
         }
      }       
   }
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_001_NEG_B"         //Negative case 401 Unauthorized - no token
      
      Test objective 
         "Check that MEO responds with an error when it receives 
         a request for creating a new App Package without credentials"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.1.3.1",
              "ETSI GS MEC 010-2 1.2.2, Table 6.2.3.2.2-1"      //AppPkg
              
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_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 "/apmi/v1/app_packages",
               "not" authorization,               //Token is mandatory
               body containing
                  AppPkg containing
                     appPkgName set to any_value
                  ;
               ;
            ; from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "401 Unauthorized"
            ; to the MEC_OSS entity
         }
      }       
   }
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_001_NEG_C"         //Negative case 401 Unauthorized - wrong token
      
      Test objective 
         "Check that MEO responds with an error when it receives 
         a request for creating a new App Package with wrong credentials"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.1.3.1",
              "ETSI GS MEC 010-2 1.2.2, Table 6.2.3.2.2-1"      //AppPkg
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_MANAGEMENT

      Initial conditions  with {
         the IUT entity being_in idle_state
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a HttpMsg containing
               headers set to vHeadersInvalidToken,      //wrong token
               uri indicating value "/apmi/v1/app_packages",
               body containing
                  AppPkg containing
                     appPkgName set to any_value
                  ;
               ;
            ; from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "401 Unauthorized"
            ; to the MEC_OSS entity
         }
      }       
   }
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_001_NEG_D"         //Negative case 404 Not found
      
      Test objective 
         "Check that MEO responds with an error when it receives 
         a request for creating a new App Package to a wrong URI"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.1.3.1",
              "ETSI GS MEC 010-2 1.2.2, Table 6.2.3.2.2-1"      //AppPkg
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_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 "/apmi/v1/appPackages",      //wrong URI
               body containing
                  AppPkg containing
                     appPkgName set to any_value
                  ;
               ;
            ; from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "404 Not Found"
            ; to the MEC_OSS entity
         }
      }       
   }
   
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_004_NEG_A"      //Negative case: 403 FORBIDDEN (operation not allowed due to the current status of the resource)
      
      Test objective
         "Check that MEO responds with an error when it receives 
         a request to enable an App Package that is already enabled"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.2.3.3"
                
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_MANAGEMENT 

      Initial conditions  with {
         the IUT entity having a App_Package containing
            appPkgId indicating value ON_BOARDED_APP_PKG_ID,
            operationalState set to "ENABLED";      //Ref. Table 6.2.3.3.2-1 MEC 010-2
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPUT containing 
               uri indicating value "/apmi/v1/app_packages/{ON_BOARDED_APP_PKG_ID}",
               uri_parameter appPkgOperation indicating value "ENABLE";      //Wrong since the app package is already enabled 
               from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "403 Forbidden",
               body containing
                  problemDetails containing
                     status set to 403,
                     detail set to any_value
                  ;
               ;
            ;
            to the MEC_OSS entity
         }
      }
   }
}
+0 −286
Original line number 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_MEO_MM1_PKGM_BV {
   
   import all from MEC_Common;
   
   //All APP packages

   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_001"
      
      Test objective 
         "Check that MEO creates a new App Package when requested"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.1.3.1",
              "ETSI GS MEC 010-2 1.2.2, Table 6.2.3.3.2-1",      //OnboardedAppPkgInfo
              "ETSI GS MEC 010-2 1.2.2, Table 6.2.3.2.2-1"      //AppPkg
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_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 "/apmi/v1/app_packages",
               body containing
                  AppPkg containing
                     appPkgName set to APP_PKG_NAME,
                     appPkgVersion set to APP_PKG_VERSION,
                     appProvider set to APP_PROVIDER,
                     checksum set to CHECKSUM,
                     appPkgPath set to APP_PKG_PATH
                  ;
               ;
            ; from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",      //TODO: it should return 201 - specification to be updated
               body containing 
                  OnboardedAppPkgInfoList containing
                     OnboardedAppPkgInfo containing
                        appPkgName set to APP_PKG_NAME,
                        appPkgVersion set to APP_PKG_VERSION,
                        appProvider set to APP_PROVIDER,
                        checksum set to CHECKSUM,
                        appPkgPath set to APP_PKG_PATH,
                        operationalState set to "ENABLED",
                        usageState set to "NOT_IN_USE"
                     ;
                  ;
               ;
            ; to the MEC_OSS entity
         }
      }       
   }
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_002a"
      
      Test objective 
         "Check that MEO returns the list of App Packages when requested"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.1.3.2",
              "ETSI GS MEC 010-2 1.2.2, Table 6.2.3.3.2-1"      //OnboardedAppPkgInfo

      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_MANAGEMENT 

      Initial conditions  with {
         the IUT entity having a App_Package containing
            appPkgId indicating value ON_BOARDED_APP_PKG_ID,
            appDId indicating value APPD_ID;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vGET containing 
               uri indicating value "/apmi/v1/app_packages";
               from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",
               body containing 
                  OnboardedAppPkgInfoList containing
                     OnboardedAppPkgInfo containing 
                        appPkgId set to ON_BOARDED_APP_PKG_ID,
                        appDId set to APPD_ID
                     ;
                  ;
               ;
            ; to the MEC_OSS entity
         }
      }
   }
   
   //Individual APP packages
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_002b"
      
      Test objective 
         "Check that MEO returns the an App Package when requested"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.2.3.2",
              "ETSI GS MEC 010-2 1.2.2, Table 6.2.3.3.2-1"      //OnboardedAppPkgInfo
                
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_MANAGEMENT 

      Initial conditions  with {
         the IUT entity having a App_Package containing
            appPkgId indicating value ON_BOARDED_APP_PKG_ID,
            appDId indicating value APPD_ID;
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vGET containing 
               uri indicating value "/apmi/v1/app_packages/{ON_BOARDED_APP_PKG_ID}";
               from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK",
               body containing 
                  OnboardedAppPkgInfo containing 
                     appPkgId set to ON_BOARDED_APP_PKG_ID,
                     appDId set to APPD_ID
                  ;
               ;
            ; to the MEC_OSS entity
         }
      }
   }
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_003"
      
      Test objective 
         "Check that MEO deletes an App Package when requested"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.2.3.4"
              
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_MANAGEMENT 

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

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vDELETE containing 
               uri indicating value "/apmi/v1/app_packages/{ON_BOARDED_APP_PKG_ID}";
               from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK"      //TODO: it should return 204 - specification to be updated
            ; to the MEC_OSS entity
         }
      }
   }
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_004"
      
      Test objective 
         "Check that MEO enables an App Package when requested"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.2.3.3"
                
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_MANAGEMENT 

      Initial conditions  with {
         the IUT entity having a App_Package containing
            appPkgId indicating value ON_BOARDED_APP_PKG_ID,
            operationalState set to "DISABLED";      //Ref. Table 6.2.3.3.2-1 MEC 010-2
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPUT containing 
               uri indicating value "/apmi/v1/app_packages/{ON_BOARDED_APP_PKG_ID}",
               uri_parameter appPkgOperation indicating value "ENABLE";
               from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK";
            to the MEC_OSS entity
         }
      }
   }
   
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MM1_PKGM_005"
      
      Test objective 
         "Check that MEO disables an App Package when requested"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.2.3.3"
                
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_MANAGEMENT 

      Initial conditions  with {
         the IUT entity having a App_Package containing
            appPkgId indicating value ON_BOARDED_APP_PKG_ID,
            operationalState set to "ENABLED";      //Ref. Table 6.2.3.3.2-1 MEC 010-2
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPUT containing 
               uri indicating value "/apmi/v1/app_packages/{ON_BOARDED_APP_PKG_ID}",
               uri_parameter appPkgOperation indicating value "DISABLE";
               from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK";
            to the MEC_OSS entity
         }
      }
   }
   
   Test Purpose {
      TP Id "TP_MEC_MEO_MEC25_MM1_PKGM_001"
      
      Test objective 
         "Check that MEO aborts an App Package deletion operation when requested"
      
      Reference "ETSI GS MEC 010-2 1.2.2, clause 7.3.2.3.3"
                
      Config Id Config_MEC_2
      PICS Selection PIC_APP_PACKAGE and PIC_APP_PACKAGE_MANAGEMENT 

      Initial conditions  with {
         the IUT entity having a App_Package containing
            appPkgId indicating value ON_BOARDED_APP_PKG_ID,
            operationalState set to "DELETION_PENDING";      //Ref. Table 6.2.3.3.2-1 MEC 010-2
      }

      Expected behaviour
      ensure that {
         when {
            the IUT entity receives a vPUT containing 
               uri indicating value "/apmi/v1/app_packages/{ON_BOARDED_APP_PKG_ID}",
               uri_parameter appPkgOperation indicating value "ABORT";
               from the MEC_OSS entity
         }
         then {
            the IUT entity sends a HTTP_RESPONSE containing
               status set to "200 OK";
            to the MEC_OSS entity
         }
      }
   }
}