You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Manual testing with Postman

  1. Build cps-and-ncmp docker image for version to be tested. Run maven from cps repo directory:

    mvn clean install -Pcps-ncmp-docker
  2. Edit docker-compose.yml to filter notifications: set NOTIFICATION_DATASPACE_FILTER_PATTERNS to NON-EXISTING-DATASPACE

    cps-and-ncmp:
      environment:
        notification.enabled: 'true'
        NOTIFICATION_DATASPACE_FILTER_PATTERNS: 'NON-EXISTING-DATASPACE'
  3. Start docker-compose with DMI plugin stub and monitoring enabled:

    docker-compose -f docker-compose/docker-compose.yml --profile dmi-stub --profile monitoring up
  4. Wait for CPS to start. Console output will show:

    cps-and-ncmp            | {"logTimeStamp":"2023-03-24T16:20:36.705Z","logLevel":"INFO","principalId":"cpsuser","serviceName":"cps-application","message":"Started Application in 47.336 seconds (JVM running for 48.444)","processId":"1","threadName":"main","class":"org.onap.cps.Application"}
  5. Test using Postman
    1. Start Postman, and import the NCMP de-register performance postman collection


    2. Click the new collection, and open the "Variables" tab


    3. Change the current value of TOTAL_CMHANDLES to the desired value, e.g. 10000, and click the "Save" button. This is the number of CM handles that will be registered (and later de-registered).


    4. Select "Register CM handles", and click "Send". (The Postman collection will use a script to automatically create the request body.)


    5. Wait until all CM handles are in READY state. This can take a while, especially with lot of handles.
      We can check how many handles are ready by running a query on the database. Here are instructions using the Postgres command line interface (psql), but you may alternatively use the Postgres GUI client.
      1. Open a new terminal window, and install postgres-client if needed:

        $ sudo apt install postgresql-client
        Reading package lists... Done
        Building dependency tree... Done
        Reading state information... Done
        postgresql-client is already the newest version (14+238).
        0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
      2. Run psql command to connect to the database (default password is cps):

        $ psql -h localhost -p 5432 cpsdb cps
        Password for user cps: 
        psql (14.6 (Ubuntu 14.6-0ubuntu0.22.04.1), server 14.1)
        Type "help" for help.
        
        cpsdb=# 
      3. Run the following query to count the number of handles in the READY state. You will need to repeat this command, until all are ready (e.g. 10000).

        cpsdb=# SELECT count(*) FROM public.fragment where attributes @> '{"cm-handle-state": "READY"}';
         count 
        -------
          3540
        (1 row)
        
        cpsdb=# SELECT count(*) FROM public.fragment where attributes @> '{"cm-handle-state": "READY"}';
         count 
        -------
         10000
        (1 row)
      4. Now that all CM handles are ready, we can proceed to test de-registration. Go back to Postman.

    6. In Postman, select "De-Register CM handles", and click "Send".
    7. Record the time taken (54.91 s in this case).
  6. Stop docker-compose:

    docker-compose -f docker-compose/docker-compose.yml down
  7. Clean up docker containers and volumes:

    docker container prune -f && docker volume prune -f

Automated testing

There is a script in the cps repo for automatic testing of NCMP handle de-registration.

$ ./test-tools/test-deregistration.sh


  • No labels