diff --git a/src/wrench/services/storage/simple/SimpleStorageService.cpp b/src/wrench/services/storage/simple/SimpleStorageService.cpp index 1d331e237b..a7952cc543 100644 --- a/src/wrench/services/storage/simple/SimpleStorageService.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageService.cpp @@ -385,11 +385,19 @@ namespace wrench { // File System at the destination auto fs = this->file_systems[dst_location->getAbsolutePathAtMountPoint()].get(); + WRENCH_INFO("HERE: %s", dst_location->getAbsolutePathAtMountPoint().c_str()); + + + fs->doesDirectoryExist(dst_location->getAbsolutePathAtMountPoint()); + WRENCH_INFO("ASD):"); + fs->isFileInDirectory(file, dst_location->getAbsolutePathAtMountPoint()); + WRENCH_INFO("ASD):"); if ((not fs->doesDirectoryExist(dst_location->getAbsolutePathAtMountPoint())) or (not fs->isFileInDirectory(file, dst_location->getAbsolutePathAtMountPoint()))) { + WRENCH_INFO("123"); if (not fs->hasEnoughFreeSpace(file->getSize())) { this->simulation->getOutput().addTimestamp( @@ -416,6 +424,7 @@ namespace wrench { return true; } } + WRENCH_INFO("123XZXZXX"); fs->decreaseFreeSpace(file->getSize()); diff --git a/src/wrench/services/storage/storage_helpers/FileLocation.cpp b/src/wrench/services/storage/storage_helpers/FileLocation.cpp index f059070f06..671faa4d1c 100644 --- a/src/wrench/services/storage/storage_helpers/FileLocation.cpp +++ b/src/wrench/services/storage/storage_helpers/FileLocation.cpp @@ -77,7 +77,7 @@ namespace wrench { absolute_path.replace(0, mount_point.length(), "/"); - return std::shared_ptr(new FileLocation(ss, mount_point, absolute_path)); + return std::shared_ptr(new FileLocation(ss, mount_point, sanitizePath(absolute_path))); } /** diff --git a/src/wrench/services/storage/storage_helpers/LocicalFileSystem.cpp b/src/wrench/services/storage/storage_helpers/LocicalFileSystem.cpp index 1c4a478397..443f9fecd0 100644 --- a/src/wrench/services/storage/storage_helpers/LocicalFileSystem.cpp +++ b/src/wrench/services/storage/storage_helpers/LocicalFileSystem.cpp @@ -60,7 +60,9 @@ namespace wrench { LogicalFileSystem::mount_points.insert(hostname+":"+mount_point); this->mount_point = mount_point; - this->content["/"] = {}; + this->content.insert(std::make_pair("/", (std::set){})); + WRENCH_INFO("INCONSTRU: %lu", this->content.size()); +// this->content["/"] = {}; this->total_capacity = S4U_Simulation::getDiskCapacity(hostname, mount_point); this->occupied_space = 0; } @@ -83,6 +85,9 @@ namespace wrench { * @return true if the directory exists */ bool LogicalFileSystem::doesDirectoryExist(std::string absolute_path) { + WRENCH_INFO("WTF %s", absolute_path.c_str()); + WRENCH_INFO("WTF %lu", this->content.size()); + WRENCH_INFO("ASDADADASDASD"); return (this->content.find(absolute_path) != this->content.end()); } diff --git a/test/compute_services/BareMetalComputeService/BareMetalComputeServiceOneTaskTest.cpp b/test/compute_services/BareMetalComputeService/BareMetalComputeServiceOneTaskTest.cpp index b65f28d0dd..4b4d3a93a2 100644 --- a/test/compute_services/BareMetalComputeService/BareMetalComputeServiceOneTaskTest.cpp +++ b/test/compute_services/BareMetalComputeService/BareMetalComputeServiceOneTaskTest.cpp @@ -80,9 +80,13 @@ class BareMetalComputeServiceOneTaskTest : public ::testing::Test { " " " " " " - " " + " " " " - " " + " " + " " + " " + " " + " " " " " " " " @@ -724,7 +728,7 @@ void BareMetalComputeServiceOneTaskTest::do_HostMemory_test() { // Create a Compute Service compute_service = simulation->add( new wrench::BareMetalComputeService(hostname1, - {std::make_pair(hostname1, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))},"/scratch'", + {std::make_pair(hostname1, std::make_tuple(wrench::ComputeService::ALL_CORES, wrench::ComputeService::ALL_RAM))}, "/scratch", {})); // Create a Storage Service @@ -1132,15 +1136,15 @@ void BareMetalComputeServiceOneTaskTest::do_ExecutionWithPrePostCopiesTaskCleanu ASSERT_THROW(simulation->instantiatePlatform(platform_file_path), std::runtime_error); // Get a hostname - std::string hostname = simulation->getHostnameList()[0]; + std::string hostname ="SingleHost"; // Create a Storage Service ASSERT_NO_THROW(storage_service1 = simulation->add( - new wrench::SimpleStorageService(hostname, {"/"}))); + new wrench::SimpleStorageService(hostname, {"/disk1"}))); // Create another Storage Service ASSERT_NO_THROW(storage_service2 = simulation->add( - new wrench::SimpleStorageService(hostname, {"/"}))); + new wrench::SimpleStorageService(hostname, {"/disk2"}))); // Create a Compute Service with default Storage Service #2 diff --git a/test/main.cpp b/test/main.cpp index f14c1ecf1b..a5c7cd86dc 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -14,7 +14,7 @@ int main(int argc, char **argv) { // disable log - xbt_log_control_set("root.thresh:critical"); +// xbt_log_control_set("root.thresh:critical"); // Example selective log enabling // xbt_log_control_set("simulation_timestamps.thresh:debug"); diff --git a/test/workflow/WorkflowTaskTest.cpp b/test/workflow/WorkflowTaskTest.cpp index 54e668f4db..cc6b0b580b 100644 --- a/test/workflow/WorkflowTaskTest.cpp +++ b/test/workflow/WorkflowTaskTest.cpp @@ -292,7 +292,6 @@ class WorkflowTaskExecutionHistoryTestWMS : public wrench::WMS { throw std::runtime_error("Job should have failed!"); } - std::cerr << "JERE\n"; wrench::StandardJob *job_that_will_complete = job_manager->createStandardJob(this->test->t4, {{this->test->small_input_file, wrench::FileLocation::LOCATION(this->test->storage_service)}, @@ -300,23 +299,18 @@ class WorkflowTaskExecutionHistoryTestWMS : public wrench::WMS { wrench::FileLocation::LOCATION(this->test->storage_service)}, {this->test->t4_output_file, wrench::FileLocation::LOCATION(this->test->storage_service)}}); - std::cerr << "JERE1\n"; job_manager->submitJob(job_that_will_complete, this->test->compute_service); - std::cerr << "JERE\n"; this->waitForAndProcessNextEvent(); - std::cerr << "JERE2\n"; wrench::StandardJob *job_that_will_be_terminated = job_manager->createStandardJob(this->test->t5, {}); job_manager->submitJob(job_that_will_be_terminated, this->test->compute_service); wrench::S4U_Simulation::sleep(10.0); job_manager->terminateJob(job_that_will_be_terminated); - std::cerr << "JERE3\n"; wrench::StandardJob *job_that_will_fail_2 = job_manager->createStandardJob(this->test->t6, {}); job_manager->submitJob(job_that_will_fail_2, this->test->compute_service); wrench::S4U_Simulation::sleep(10.0); - std::cerr << "JERE4\n"; this->test->compute_service->stop(); return 0;