Scheduler Test Cases

Below is a list of scheduler test cases that should be executed by one or more members of the team. Some of these test cases may be covered by other tests or by ad-hoc testing.

Return to Manual Test Cases.
Return to 20-specific Test Suite.

Scheduler Start/Stop

Testcase Name Scheduler Start/Stop Estimated run time 10 min
Purpose Test starting and stopping scheduler
Dependencies Jobs must be started for some of these tests
Step Action Expected Results
1. Can scheduler be started and stopped using sudo /etc/init.d/fossology verify scheduler is running and logging to /var/log/fossology/fossology.log
2. Start 2 uploads, then perform a graceful shutdown via the [Admin]->[Scheduler] menu in the UI Is it a graceful shutdown? i.e. running agents should be allowed to complete the item. (e.g. Nomos finishes processing that item and then is killed).
3. Restart scheduler Are the remaining jobs (from Step 2) resumed? They should be.

CLI Tests

Testcase Name Scheduler Parameters Estimated run time ?? min
Purpose Test input parameters and combinations
Dependencies Jobs must be started for some of these tests

Usage:
fo_scheduler [OPTION...] - scheduler for FOSSology

Help Options:
-h, --help Show help options

Application Options:
-d, --daemon Run scheduler as daemon
-i, --database Initialize database connection and exit
-k, --kill Forcibly kills all running schedulers
-s, --shutdown Gracefully shutdown of all running schedulers
-L, --log [str] Specify location of log file
-p, --port [num] Set the interface port
-R, --reset Reset the job queue upon startup
-t, --test Close the scheduler after running tests
-v, --verbose [num] Set the scheduler verbose level
-c, --config [str] Specify system configuration directory

Step Action Expected Results
1. start scheduler with /etc/init.d/fossology and then change verbosity level. Verify with ps that scheduler is using new verbosity level
2. Change verbosity level to an invalid verbosity level, what happens? what happens?
3. Change verbosity levels up and down for each change, verify the correct level is being used
4. While jobs are running, stop scheduler with -k All agents should be kill immediately
5. When jobs are stopped by killing scheduler with -k are they marked as failed? Verify with Show jobs and look in fossology.log
6. More tests cases needed.....

Agent Communication

Testcase Name Scheduler/Agent coordination test1 Estimated run time 10 min
Purpose Test coordination and communication between scheduler and agents
Dependencies Jobs must be started, and one or more test agents should be created to cause the failure modes
Step Action Expected Results
1. upload a file with a known number of items. Unpack/adj2nest only (no agents scheduled). Verify correct number of items is shown in both the fossology.log and showjobs in the ui.
2. Pause an agent/sub-job Agent should never be killed by scheduler
3. Modify an agent to sleep for over 2 minutes Scheduler should kill it after two minutes Use sudo kill -STOP {pid} to force the agent to sleep.
4. Modify agent to sleep after sending Heart #1 for over 10 min. Scheduler should kill agent after 10 minutes Use sudo kill -STOP {pid} to force the agent to sleep.
5. Remove directory ...etc/fossology/mod-enabled & restart the scheduler Does scheduler fail gracefully with appropriate message in fossology.log?
Testcase Name Scheduler/Agent coordination test2 Estimated run time 10 min
Purpose Test coordination and communication between scheduler and agents
Dependencies Scheduler must not be running. Attempts to schedule agents should result in a message indicating the scheduler may not be running. NOTE: This is only true after enhancement http://www.fossology.org/issues/3507. Before 3507 the job should schedule, there just won't be any errors, warnings or notes.
Step Action Expected Results
1. ensure the scheduler is not running
2. use the UI to schedule an agent which has not been previously run (i.e. Jobs -> Schedule Agents) After clicking the "Upload" button, you should get this message: "Is the scheduler running? The file {filename} has been uploaded."

Stress Test

Testcase Name Scheduler Stress Test Estimated run time 20 min
Purpose Verify scheduler functions correctly under large load
Dependencies
Step Action Expected Results
1. Start several (~5) uploads simultaneously using phpunit src/cli/tests/test_cp2foss.php All jobs should get scheduled and run to completion without error
2. Repeat step 1, with an increasing number of uploads Scheduler will eventually fail from exceeding system resources

Glib version

Testcase Name Scheduler/Glib_version Estimated run time 10 min
Purpose Test that scheduler runs properly on glib >= 2.32 and glib < 2.32
Dependencies
Step Action Expected Results
1. Install glib >= 2.32
2. Compile scheduler
3. Start scheduler and submit two jobs Jobs should start and run normally. Check for excessive (near 100%) cpu time.
4. Install glib < 2.32
5. Compile scheduler
6. Start scheduler and submit two jobs Jobs should start and run normally. Check for excessive (near 100%) cpu time. Compare to step 3.

table template below:

Purpose
Dependencies
Step Action Expected Results
1.
2.
3.