Skip to content

Commit

Permalink
fixing tests (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Sep 25, 2019
1 parent 12a3d9f commit f36e8fe
Show file tree
Hide file tree
Showing 10 changed files with 582 additions and 438 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ class BareMetalComputeServiceTestPilotJobs : public ::testing::Test {
"<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">"
"<platform version=\"4.1\"> "
" <zone id=\"AS0\" routing=\"Full\"> "
" <host id=\"DualCoreHost\" speed=\"1f\" core=\"2\"/> "
" <host id=\"DualCoreHost\" speed=\"1f\" core=\"2\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" </host>"
" </zone> "
"</platform>";
FILE *platform_file = fopen(platform_file_path.c_str(), "w");
Expand Down Expand Up @@ -125,7 +130,7 @@ class BareMetalComputeServiceUnsupportedPilotJobsTestWMS : public wrench::WMS {
auto cause = std::dynamic_pointer_cast<wrench::JobTypeNotSupported>(e.getCause());
if (not cause) {
throw std::runtime_error("Did get the expected exception but unexpected failure cause: " +
e.getCause()->toString() + " (expected: JobTypeNotSupported)");
e.getCause()->toString() + " (expected: JobTypeNotSupported)");
}
}

Expand Down Expand Up @@ -155,7 +160,7 @@ void BareMetalComputeServiceTestPilotJobs::do_UnsupportedPilotJobs_test() {

// Create A Storage Services
ASSERT_NO_THROW(storage_service = simulation->add(
new wrench::SimpleStorageService(hostname, 100.0)));
new wrench::SimpleStorageService(hostname, {"/"})));

// Create a Compute Service
ASSERT_NO_THROW(compute_service = simulation->add(
Expand All @@ -182,7 +187,8 @@ void BareMetalComputeServiceTestPilotJobs::do_UnsupportedPilotJobs_test() {


// Staging the input file on the storage service
ASSERT_NO_THROW(simulation->stageFiles({{input_file->getID(), input_file}}, storage_service));
ASSERT_NO_THROW(simulation->stageFile(input_file,
wrench::FileLocation::LOCATION(storage_service)));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,26 @@ class BareMetalComputeServiceTestStandardJobs : public ::testing::Test {
"<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">"
"<platform version=\"4.1\"> "
" <zone id=\"AS0\" routing=\"Full\"> "
" <host id=\"DualCoreHost\" speed=\"1f\" core=\"2\"/> "
" <host id=\"QuadCoreHost\" speed=\"1f\" core=\"4\"/> "
" <host id=\"DualCoreHost\" speed=\"1f\" core=\"2\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host>"
" <host id=\"QuadCoreHost\" speed=\"1f\" core=\"4\"> "
" <disk id=\"large_disk\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100\"/>"
" <prop id=\"mount\" value=\"/\"/>"
" </disk>"
" <disk id=\"scratch\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"100\"/>"
" <prop id=\"mount\" value=\"/scratch\"/>"
" </disk>"
" </host>"
" <link id=\"1\" bandwidth=\"5000GBps\" latency=\"0us\"/>"
" <route src=\"DualCoreHost\" dst=\"QuadCoreHost\"> <link_ctn id=\"1\"/> </route>"
" </zone> "
Expand Down Expand Up @@ -213,7 +231,7 @@ void BareMetalComputeServiceTestStandardJobs::do_UnsupportedStandardJobs_test()

// Create A Storage Services
ASSERT_NO_THROW(storage_service = simulation->add(
new wrench::SimpleStorageService(hostname, 100.0)));
new wrench::SimpleStorageService(hostname, {"/"})));

// Create a Compute Service
ASSERT_NO_THROW(compute_service = simulation->add(
Expand All @@ -234,7 +252,7 @@ void BareMetalComputeServiceTestStandardJobs::do_UnsupportedStandardJobs_test()


// Staging the input file on the storage service
ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service));
ASSERT_NO_THROW(simulation->stageFile(input_file, wrench::FileLocation::LOCATION(storage_service)));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down Expand Up @@ -319,7 +337,7 @@ void BareMetalComputeServiceTestStandardJobs::do_BogusNumCores_test() {

// Create A Storage Services
ASSERT_NO_THROW(storage_service = simulation->add(
new wrench::SimpleStorageService(hostname, 100.0)));
new wrench::SimpleStorageService(hostname, {"/"})));

// Create a Compute Service
ASSERT_NO_THROW(compute_service = simulation->add(
Expand All @@ -340,7 +358,8 @@ void BareMetalComputeServiceTestStandardJobs::do_BogusNumCores_test() {


// Staging the input file on the storage service
ASSERT_NO_THROW(simulation->stageFiles({{input_file->getID(), input_file}}, storage_service));
ASSERT_NO_THROW(simulation->stageFile(input_file,
wrench::FileLocation::LOCATION(storage_service)));

// Running a "run a single task" simulation
ASSERT_NO_THROW(simulation->launch());
Expand Down Expand Up @@ -440,7 +459,7 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoSingleCoreTasks_test() {

// Create A Storage Services
ASSERT_NO_THROW(storage_service = simulation->add(
new wrench::SimpleStorageService(hostname, 100.0)));
new wrench::SimpleStorageService(hostname, {"/"})));

// Create a Compute Service
ASSERT_NO_THROW(compute_service = simulation->add(
Expand Down Expand Up @@ -562,7 +581,7 @@ void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase1_test() {

// Create A Storage Services
ASSERT_NO_THROW(storage_service = simulation->add(
new wrench::SimpleStorageService(hostname, 100.0)));
new wrench::SimpleStorageService(hostname, {"/"})));

// Create a Compute Service
ASSERT_NO_THROW(compute_service = simulation->add(
Expand Down
48 changes: 32 additions & 16 deletions test/storage_services/SimpleStorageService/ChunkingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ class SimpleStorageServiceChunkingTest : public ::testing::Test {
"<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">"
"<platform version=\"4.1\"> "
" <zone id=\"AS0\" routing=\"Full\"> "
" <host id=\"StorageHost\" speed=\"1f\"/> "
" <host id=\"StorageHost\" speed=\"1f\"> "
" <disk id=\"disk1\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"1000\"/>"
" <prop id=\"mount\" value=\"/disk1\"/>"
" </disk>"
" <disk id=\"disk2\" read_bw=\"100MBps\" write_bw=\"40MBps\">"
" <prop id=\"size\" value=\"1000\"/>"
" <prop id=\"mount\" value=\"/disk2\"/>"
" </disk>"
" </host>"
" <host id=\"WMSHost\" speed=\"1f\"/> "
" <link id=\"link\" bandwidth=\"100Bps\" latency=\"100us\"/>"
" <route src=\"WMSHost\" dst=\"StorageHost\">"
Expand Down Expand Up @@ -71,18 +80,28 @@ class SimpleStorageServiceChunkingTestWMS : public wrench::WMS {
auto data_movement_manager = this->createDataMovementManager();

if (mode == "reading") {
this->test->storage_service_1->readFile(this->test->file_size_0);
this->test->storage_service_1->readFile(this->test->file_size_100);
wrench::StorageService::readFile(
this->test->file_size_0,
wrench::FileLocation::LOCATION(this->test->storage_service_1));
wrench::StorageService::readFile(
this->test->file_size_100,
wrench::FileLocation::LOCATION(this->test->storage_service_1));

} else if (mode == "writing") {
this->test->storage_service_2->writeFile(this->test->file_size_0);
this->test->storage_service_2->writeFile(this->test->file_size_100);
wrench::StorageService::writeFile(
this->test->file_size_0,
wrench::FileLocation::LOCATION(this->test->storage_service_2));
wrench::StorageService::writeFile(
this->test->file_size_100,
wrench::FileLocation::LOCATION(this->test->storage_service_2));

} else if (mode == "copying") {
data_movement_manager->doSynchronousFileCopy(this->test->file_size_0,
this->test->storage_service_1,
this->test->storage_service_2);
wrench::FileLocation::LOCATION(this->test->storage_service_1),
wrench::FileLocation::LOCATION(this->test->storage_service_2));
data_movement_manager->doSynchronousFileCopy(this->test->file_size_100,
this->test->storage_service_1,
this->test->storage_service_2);
wrench::FileLocation::LOCATION(this->test->storage_service_1),
wrench::FileLocation::LOCATION(this->test->storage_service_2));

}

Expand Down Expand Up @@ -118,14 +137,14 @@ void SimpleStorageServiceChunkingTest::do_ChunkingTest(std::string mode) {

// Create One Storage Service
ASSERT_NO_THROW(storage_service_1 = simulation->add(
new wrench::SimpleStorageService("StorageHost", 1000,
new wrench::SimpleStorageService("StorageHost", {"/disk1"},
{{wrench::SimpleStorageServiceProperty::BUFFER_SIZE, "5"},
{wrench::SimpleStorageServiceProperty::MAX_NUM_CONCURRENT_DATA_CONNECTIONS, "10"}}
)));

// Create Another Storage Service
ASSERT_NO_THROW(storage_service_2 = simulation->add(
new wrench::SimpleStorageService("StorageHost", 1000,
new wrench::SimpleStorageService("StorageHost", {"/disk2"},
{{wrench::SimpleStorageServiceProperty::BUFFER_SIZE, "10"},
{wrench::SimpleStorageServiceProperty::MAX_NUM_CONCURRENT_DATA_CONNECTIONS, "10"}}
)));
Expand All @@ -142,11 +161,8 @@ void SimpleStorageServiceChunkingTest::do_ChunkingTest(std::string mode) {
wms->addWorkflow(this->workflow);

// Stage the file on the StorageHost
ASSERT_NO_THROW(simulation->stageFiles({
{file_size_0->getID(), file_size_0},
{file_size_100->getID(), file_size_100},
},
storage_service_1));
ASSERT_NO_THROW(simulation->stageFile(file_size_0, wrench::FileLocation::LOCATION(storage_service_1)));
ASSERT_NO_THROW(simulation->stageFile(file_size_100, wrench::FileLocation::LOCATION(storage_service_1)));

ASSERT_NO_THROW(simulation->launch());

Expand Down
Loading

0 comments on commit f36e8fe

Please sign in to comment.