From c97cae03adbd2e3159e5e909b050183dbcf49d60 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Tue, 28 Mar 2017 10:48:22 +0200 Subject: [PATCH] leak plug and test AS properties --- examples/msg/platform-properties/platform-properties.c | 7 +++++++ examples/msg/platform-properties/platform-properties.tesh | 4 ++++ src/surf/xml/surfxml_sax_cb.cpp | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/msg/platform-properties/platform-properties.c b/examples/msg/platform-properties/platform-properties.c index dfc751f0e3..83acf804d2 100644 --- a/examples/msg/platform-properties/platform-properties.c +++ b/examples/msg/platform-properties/platform-properties.c @@ -64,6 +64,13 @@ static int david(int argc, char *argv[]) {/* Dump what we have on a remote host static int bob(int argc, char *argv[]) { + /* this host also tests the properties of the AS*/ + msg_as_t root = MSG_environment_get_routing_root(); + XBT_INFO("== Print the properties of the AS"); + XBT_INFO(" Process property: filename -> %s", MSG_environment_as_get_property_value(root, "filename")); + XBT_INFO(" Process property: date -> %s", MSG_environment_as_get_property_value(root, "date")); + XBT_INFO(" Process property: author -> %s", MSG_environment_as_get_property_value(root, "author")); + /* Get the property list of current bob process */ xbt_dict_t props = MSG_process_get_properties(MSG_process_self()); xbt_dict_cursor_t cursor = NULL; diff --git a/examples/msg/platform-properties/platform-properties.tesh b/examples/msg/platform-properties/platform-properties.tesh index 518a2db552..aea23f3405 100644 --- a/examples/msg/platform-properties/platform-properties.tesh +++ b/examples/msg/platform-properties/platform-properties.tesh @@ -12,6 +12,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-properties$EXEEXT ${srcdir:=.}/prop.xml $ > [ 0.000000] (0:maestro@) Host 'node-2.acme.org' runs at 1000000000 flops/s > [ 0.000000] (0:maestro@) Host 'node-3.acme.org' runs at 1000000000 flops/s > [ 0.000000] (0:maestro@) Host 'node-4.acme.org' runs at 1000000000 flops/s +> [ 0.000000] (2:bob@host1) == Print the properties of the AS +> [ 0.000000] (2:bob@host1) Process property: filename -> prop.xml +> [ 0.000000] (2:bob@host1) Process property: date -> 31-08-12 +> [ 0.000000] (2:bob@host1) Process property: author -> pnavarro > [ 0.000000] (2:bob@host1) == Print the properties of the process > [ 0.000000] (2:bob@host1) Process property: SomeProp -> SomeValue > [ 0.000000] (2:bob@host1) == Try to get a process property that does not exist diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index b0c48e4f73..43f712cf97 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -484,7 +484,7 @@ void STag_surfxml_prop() XBT_DEBUG("Set AS property %s -> %s", A_surfxml_prop_id, A_surfxml_prop_value); simgrid::s4u::NetZone* netzone = simgrid::s4u::Engine::instance()->netzoneByNameOrNull(A_surfxml_AS_id); - netzone->setProperty(A_surfxml_prop_id, xbt_strdup(A_surfxml_prop_value)); + netzone->setProperty(A_surfxml_prop_id, A_surfxml_prop_value); } else{ if (!current_property_set) -- 2.20.1