Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
slightly augment this test (unlink)
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 5 Dec 2017 09:35:26 +0000 (10:35 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 5 Dec 2017 09:35:26 +0000 (10:35 +0100)
examples/s4u/io/s4u-io.cpp
examples/s4u/io/s4u-io.tesh

index ac0ff0f..7e6c110 100644 (file)
@@ -76,7 +76,15 @@ public:
     storage->setUserdata(new std::string("Some user data"));
     std::string* storage_data = static_cast<std::string*>(storage->getUserdata());
     XBT_INFO("    Set and get data: '%s'", storage_data->c_str());
+
     delete storage_data;
+
+    // Reopen the file and then unlink it
+    file = new simgrid::s4u::File("/home/tmp/simgrid.readme", nullptr);
+    XBT_INFO("Unlink file: '%s'", file->getPath());
+    file->unlink();
+
+    show_info(mounts);
   }
 };
 
@@ -84,10 +92,7 @@ int main(int argc, char **argv)
 {
   simgrid::s4u::Engine e(&argc, argv);
   sg_storage_file_system_init();
-  const char* platffile = "../../platforms/storage/storage.xml";
-  if (argc > 1)
-    platffile = argv[1];
-  e.loadPlatform(platffile);
+  e.loadPlatform(argv[1]);
   simgrid::s4u::Actor::createActor("host", simgrid::s4u::Host::by_name("denise"), MyHost());
   e.run();
 
index f00cee2..1c3ae8b 100644 (file)
@@ -15,3 +15,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-io ${platfdir}/storage/storage.xml
 > [denise:host:(1) 0.006000] [s4u_test/INFO] Get/set data for storage element: Disk4
 > [denise:host:(1) 0.006000] [s4u_test/INFO]     Uninitialized storage data: '(null)'
 > [denise:host:(1) 0.006000] [s4u_test/INFO]     Set and get data: 'Some user data'
+> [denise:host:(1) 0.006000] [s4u_test/INFO] Unlink file: '/home/tmp/simgrid.readme'
+> [denise:host:(1) 0.006000] [s4u_test/INFO] Storage info on denise:
+> [denise:host:(1) 0.006000] [s4u_test/INFO]     Disk2 (c:) Used: 2391537133; Free: 534479374867; Total: 536870912000.
+> [denise:host:(1) 0.006000] [s4u_test/INFO]     Disk4 (/home) Used: 13221994; Free: 536857690006; Total: 536870912000.