Skip to content

7. Running test scripts on MOC using pfconclient

Sandip Samal edited this page Apr 8, 2021 · 6 revisions

If both pman & pfcon were deployed successfully, you should be able to see the containers running on openshift (see image below) pman & pfcon deployed

NOTE: The routes seen above will be used to test the scripts

TESTS

Pre-requisites:

You will need to create a python virtual environment and install pfconclient to execute the below test scripts. Follow the Github repo mentioned below to create a virtual env and install pfconclient https://github.com/FNNDSC/python-pfconclient

You will also need to install httpie to run some of the test scripts

Now download the test scripts from : https://github.com/FNNDSC/ChRIS-E2E

cd ChRIS-E2E/scripts

IMPORTANT: Sometimes, you can get an invalid response like 502 or 401 error when you execute the scripts. To resolve this delete and recreate kubecfg. See step 4 wiki

Example

  1. Test hello on pman
# http <pman route>/api/v1/hello/


(python_env) sandip@117:~/ChRIS-E2E/scripts$ http pman-test-moc.k-apps.osh.massopen.cloud/api/v1/hello/
HTTP/1.0 200 OK
Cache-control: private
Connection: keep-alive
Content-Length: 1169
Content-Type: application/json
Date: Thu, 08 Apr 2021 16:06:06 GMT
Server: Werkzeug/1.0.1 Python/3.8.5
Set-Cookie: 34818222e0ceabc489c3a23f186232d3=18d48e7c6a1fc6f37e67d9675edeb855; path=/; HttpOnly

{
    "d_ret": {
        "message": "pman says hello from openshift 😃",
        "sysinfo": {
            "cpu_percent": 1.0,
            "cpucount": 56,
            "hostname": "pman-1-dw9lt",
            "inet": "10.128.9.36",
            "loadavg": [
                0.43,
                0.62,
                0.57
            ],
            "machine": "x86_64",
            "memory": [
                115996803072,
                107742302208,
                7.1,
                7485591552,
                89228800000,
                13809696768,
                9389817856,
                2138112,
                19280273408,
                11825152,
                2015059968
            ],
            "platform": "Linux-3.10.0-1127.el7.x86_64-x86_64-with-glibc2.29",
            "system": "Linux",
            "uname": [
                "Linux",
                "pman-1-dw9lt",
                "3.10.0-1127.el7.x86_64",
                "#1 SMP Tue Feb 18 16:39:12 EST 2020",
                "x86_64",
                "x86_64"
            ],
            "version": "#1 SMP Tue Feb 18 16:39:12 EST 2020"
        }
    },
    "status": true
}

  1. Test pfcon

Create a folder /tmp/small & add some files above 100KB to that folder first. Then run the below scripts

# ./post_pfcon_ds <pfcon-route> <job-id>

(python_env) sandip@117:~/ChRIS-E2E/scripts$ ./post_pfcon_ds pfcon-test-moc.k-apps.osh.massopen.cloud jid800

Submitting job jid800 to pfcon service at -->http://pfcon-test-moc.k-apps.osh.massopen.cloud/api/v1/<--...
Waiting for 2s before next polling for job status ...

Polling job jid800 status, poll number: 1
Job jid800 status: ['started']
Waiting for 4s before next polling for job status ...

Polling job jid800 status, poll number: 2
Job jid800 status: ['started']
Waiting for 8s before next polling for job status ...


  1. View the containers in openstack

pfcon success

  1. View the pod logs (see image below) pod logs