Test Case Execution

In the home folder of the logged-in user, there is a Python script name "qjob.py". This script handles test scheduling.

Following is a brief usage of the script:

oper@ftasvm:~$ ./qjob.py -h
usage: qjob.py [-h] [-a {add,remove,show,kill_job} | -S {running,paused}] [-s SUITEFILE] [-V]

Test Job Queue Submitter

optional arguments:
  -h, --help            show this help message and exit
  -a {add,remove,show,kill_job}, --action {add,remove,show,kill_job}
                        add: Add job to queue; remove: remove job from queue; show: show queue; kill_job: kill running job
  -S {running,paused}, --status {running,paused}
                        Set queue execution status. ["running" or "paused"]
  -s SUITEFILE, --suitefile SUITEFILE
                        Yaml testsuite file to send to the execution queue
  -V, --version         Show FTAS VM version
oper@ftasvm:~$ 

The script can take the following actions:

  • Show the current queue

oper@ftasvm:~$ ./qjob.py -a show
Job_Queue:  []
Queue Status:  paused
oper@ftasvm:~$ 

When no tests are scheduled the script will show an empty queue.

  • Adding test suite to the queue

oper@ftasvm:~$ ./qjob.py -a add -s testsuites/data_2dut.suite   
oper@ftasvm:~$ ./qjob.py -a add -s testsuites/data_4dut.suite  

oper@ftasvm:~$ ./qjob.py -a show
Job_Queue:  ['/home/oper/testsuites/data_2dut.suite', '/home/oper/testsuites/data_4dut.suite']
Queue Status:  paused
oper@ftasvm:~$ 

we can add multiple test suits to the queue at any time to be executed.

  • Removing the test suite from the queue

oper@ftasvm:~$ ./qjob.py -a remove -s /home/oper/testsuites/data_4dut.suite 
[INFO]: Test job removed /home/oper/testsuites/data_4dut.suite
oper@ftasvm:~$ 

oper@ftasvm:~$ ./qjob.py -a show
Job_Queue:  ['/home/oper/testsuites/data_2dut.suite']
Queue Status:  paused
oper@ftasvm:~$ 
  • Changing queue status

There are two statuses in the job queue:

When the job queue is in "paused" status, the test_runner service does not pick any job in the queue for execution.

When the job queue is in "running" status, the test_runner service picks the oldest job in the queue for execution. After the test case execution is complete the queue test_runner service changes the queue status to "paused".

oper@linux:~$ ./qjob.py -S running

Changing the queue status from running to paused when there is a running job, won't stop the running job but the test_runner service won't pick the next job for execution.

  • Kill or terminate a running job

After terminating the running job test_runner service pauses the queue.

oper@linux:~$ ./qjob.py -a kill_job
Trying to terminate running job...done
[INFO]: The queue is paused. Please update its status after your debugging

oper@linux:~$ ./qjob.py -a remove -s /home/oper/testsuites/data_2dut.suite 
[INFO]: Test job removed /home/oper/testsuites/data_2dut.suite
oper@ftasvm:~$