Skip to content

Commit

Permalink
(#2) passing tests ++
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 8, 2019
1 parent 532cfd1 commit 2e64309
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void BareMetalComputeServiceTestPilotJobs::do_UnsupportedPilotJobs_test() {
ASSERT_NO_THROW(compute_service = simulation->add(
new wrench::BareMetalComputeService(hostname,
{std::make_pair(hostname, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))},
0,
"",
{{wrench::BareMetalComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}})));

// Create a WMS
Expand Down
143 changes: 76 additions & 67 deletions test/energy_consumption/EnergyConsumptionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,65 +51,74 @@ class EnergyConsumptionTest : public ::testing::Test {

// Create a four-host 1-core platform file along with different pstates
std::string xml = "<?xml version='1.0'?>"
"<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">"
"<platform version=\"4.1\">"
"<zone id=\"AS0\" routing=\"Full\">"
"<host id=\"MyHost1\" speed=\"100.0Mf,50.0Mf,20.0Mf\" pstate=\"0\" core=\"1\" >"
"<prop id=\"watt_per_state\" value=\"100.0:200.0, 93.0:170.0, 90.0:150.0\" />"
"<prop id=\"watt_off\" value=\"10B\" />"
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host>"
"</host>"

"<host id=\"MyHost2\" speed=\"100.0Mf,50.0Mf,20.0Mf\" pstate=\"0\" core=\"1\" >"
"<prop id=\"watt_per_state\" value=\"100.0:200.0, 93.0:170.0, 90.0:150.0\" />"
"<prop id=\"watt_off\" value=\"10B\" />"
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host>"
"</host>"

"<host id=\"MyHost3\" speed=\"100.0Mf,50.0Mf,20.0Mf\" pstate=\"0\" core=\"1\" >"
"<prop id=\"watt_per_state\" value=\"100.0:200.0, 93.0:170.0, 90.0:150.0\" />"
"<prop id=\"watt_off\" value=\"10B\" />"
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host>"
"</host>"

"<link id=\"bus\" bandwidth=\"100kBps\" latency=\"0\" sharing_policy=\"SHARED\">"
"<prop id=\"watt_range\" value=\"1:3\" />"
"</link>"
"<route src=\"MyHost1\" dst=\"MyHost2\">"
"<link_ctn id=\"bus\"/>"
"</route>"
"<route src=\"MyHost1\" dst=\"MyHost3\">"
"<link_ctn id=\"bus\"/>"
"</route>"
"<route src=\"MyHost2\" dst=\"MyHost3\">"
"<link_ctn id=\"bus\"/>"
"</route>"
"</zone>"
"</platform>";
"<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">"
"<platform version=\"4.1\">"
"<zone id=\"AS0\" routing=\"Full\">"
"<host id=\"MyHost1\" speed=\"100.0Mf,50.0Mf,20.0Mf\" pstate=\"0\" core=\"1\" >"
" <disk id=\"large_disk1\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/disk1\"/>"
" </disk>"
" <disk id=\"large_disk2\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/disk2\"/>"
" </disk>"
" <disk id=\"large_disk3\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" <prop id=\"watt_per_state\" value=\"100.0:200.0, 93.0:170.0, 90.0:150.0\" />"
" <prop id=\"watt_off\" value=\"10B\" />"
"</host>"

"<host id=\"MyHost2\" speed=\"100.0Mf,50.0Mf,20.0Mf\" pstate=\"0\" core=\"1\" >"
" <disk id=\"large_disk1\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/disk1\"/>"
" </disk>"
" <disk id=\"large_disk2\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/disk2\"/>"
" </disk>"
" <disk id=\"large_disk3\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" <prop id=\"watt_per_state\" value=\"100.0:200.0, 93.0:170.0, 90.0:150.0\" />"
" <prop id=\"watt_off\" value=\"10B\" />"
"</host>"

"<host id=\"MyHost3\" speed=\"100.0Mf,50.0Mf,20.0Mf\" pstate=\"0\" core=\"1\" >"
" <disk id=\"large_disk1\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/disk2\"/>"
" </disk>"
" <disk id=\"large_disk2\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/disk2\"/>"
" </disk>"
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" <prop id=\"watt_per_state\" value=\"100.0:200.0, 93.0:170.0, 90.0:150.0\" />"
" <prop id=\"watt_off\" value=\"10B\" />"
"</host>"

"<link id=\"bus\" bandwidth=\"100kBps\" latency=\"0\" sharing_policy=\"SHARED\">"
"<prop id=\"watt_range\" value=\"1:3\" />"
"</link>"
"<route src=\"MyHost1\" dst=\"MyHost2\">"
"<link_ctn id=\"bus\"/>"
"</route>"
"<route src=\"MyHost1\" dst=\"MyHost3\">"
"<link_ctn id=\"bus\"/>"
"</route>"
"<route src=\"MyHost2\" dst=\"MyHost3\">"
"<link_ctn id=\"bus\"/>"
"</route>"
"</zone>"
"</platform>";
FILE *platform_file = fopen(platform_file_path.c_str(), "w");
fprintf(platform_file, "%s", xml.c_str());
fclose(platform_file);
Expand Down Expand Up @@ -293,11 +302,11 @@ void EnergyConsumptionTest::do_AccessEnergyApiExceptionTests_test() {

// Create a Storage Service
EXPECT_NO_THROW(storage_service1 = simulation->add(
new wrench::SimpleStorageService(hostname, {"/"})));
new wrench::SimpleStorageService(hostname, {"/disk1"})));

// Create a Storage Service
EXPECT_NO_THROW(storage_service2 = simulation->add(
new wrench::SimpleStorageService(hostname, {"/"})));
new wrench::SimpleStorageService(hostname, {"/disk2"})));


// Create a Compute Service
Expand Down Expand Up @@ -448,11 +457,11 @@ void EnergyConsumptionTest::do_EnergyConsumption_test() {

// Create a Storage Service
EXPECT_NO_THROW(storage_service1 = simulation->add(
new wrench::SimpleStorageService(hostname, {"/"})));
new wrench::SimpleStorageService(hostname, {"/disk1"})));

// Create a Storage Service
EXPECT_NO_THROW(storage_service2 = simulation->add(
new wrench::SimpleStorageService(hostname, {"/"})));
new wrench::SimpleStorageService(hostname, {"/disk2"})));


// Create a Compute Service
Expand Down Expand Up @@ -601,11 +610,11 @@ void EnergyConsumptionTest::do_SimpleApiChecksEnergy_test() {

// Create a Storage Service
EXPECT_NO_THROW(storage_service1 = simulation->add(
new wrench::SimpleStorageService(hostname, {"/"})));
new wrench::SimpleStorageService(hostname, {"/disk1"})));

// Create a Storage Service
EXPECT_NO_THROW(storage_service2 = simulation->add(
new wrench::SimpleStorageService(hostname, {"/"})));
new wrench::SimpleStorageService(hostname, {"/disk2"})));


// Create a Compute Service
Expand Down Expand Up @@ -835,11 +844,11 @@ void EnergyConsumptionTest::do_EnergyConsumptionPStateChange_test() {

// Create a Storage Service
EXPECT_NO_THROW(storage_service1 = simulation->add(
new wrench::SimpleStorageService(hostname, {"/"})));
new wrench::SimpleStorageService(hostname, {"/disk1"})));

// Create a Storage Service
EXPECT_NO_THROW(storage_service2 = simulation->add(
new wrench::SimpleStorageService(hostname, {"/"})));
new wrench::SimpleStorageService(hostname, {"/disk2"})));


// Create a Compute Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class BareMetalComputeServiceHostFailuresTest : public ::testing::Test {
" </disk>"
" </host> "
" <host id=\"StableHost\" speed=\"1f\" core=\"1\"> "
" <disk id=\"large_disk\" 10000000000000=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100B\"/>"
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"10000000000000B\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
Expand Down

0 comments on commit 2e64309

Please sign in to comment.