FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
testHost.c File Reference

Unit test for host operations. More...

#include <testRun.h>
#include <host.h>
Include dependency graph for testHost.c:

Go to the source code of this file.

Functions

void test_host_init ()
 Test for host_init() More...
 
void test_host_insert ()
 Test for host_insert() More...
 
void test_host_increase_load ()
 Test for host_increase_load() More...
 
void test_host_decrease_load ()
 Test for host_decrease_load() More...
 
void test_get_host ()
 Test for get_host() More...
 

Variables

CU_TestInfo tests_host []
 

Detailed Description

Unit test for host operations.

Definition in file testHost.c.

Function Documentation

void test_get_host ( )

Test for get_host()

Test:
  1. Initialize the scheduler using scheduler_init()
  2. Add hosts to the scheduler with different capacity using host_insert()
  3. Get the hosts from scheduler using get_host.
  4. Check the name of the host for a given capacity

Definition at line 151 of file testHost.c.

void test_host_decrease_load ( )

Test for host_decrease_load()

Test:
  1. Initialize host using host_init()
  2. Set the host load to 2
  3. Call host_decrease_load() on the host
  4. Check if the running agents on host are decreasing

Definition at line 129 of file testHost.c.

void test_host_increase_load ( )

Test for host_increase_load()

Test:
  1. Initialize host using host_init()
  2. Check the running agents on host are 0
  3. Call host_increase_load() on the host
  4. Check if the running agents on host are increasing

Definition at line 108 of file testHost.c.

void test_host_init ( )

Test for host_init()

Test:
  1. Create a host using host_init()
  2. Check if the host returned is not NULL
  3. Check if the host gets name, address, agent_dir and max properly
  4. Check if the host has no running agents
  5. Destroy the host

Definition at line 39 of file testHost.c.

void test_host_insert ( )

Test for host_insert()

Test:
  1. Initialize scheduler using scheduler_init()
  2. Create a host using host_init()
  3. Insert the host to the scheduler using host_insert()
  4. Check if scheduler's host list and queue size increases
  5. Verify if the hosts are added in the given order to the scheduler's host queue

Definition at line 64 of file testHost.c.

Variable Documentation

CU_TestInfo tests_host[]
Initial value:
=
{
{"Test host_init", test_host_init },
{"Test host_insert", test_host_insert },
{"Test host_increase_load", test_host_increase_load },
{"Test host_decrease_load", test_host_decrease_load },
{"Test host_get_host", test_get_host },
CU_TEST_INFO_NULL
}
void test_get_host()
Test for get_host()
Definition: testHost.c:151
void test_host_increase_load()
Test for host_increase_load()
Definition: testHost.c:108
void test_host_init()
Test for host_init()
Definition: testHost.c:39
void test_host_decrease_load()
Test for host_decrease_load()
Definition: testHost.c:129
void test_host_insert()
Test for host_insert()
Definition: testHost.c:64

Definition at line 196 of file testHost.c.