SoW-2020-0003: Trace Hit Counters
[lttng-tools.git] / tests / regression / tools / save-load / test_load
index 1f1d01d256d900dfb9b46f987a3ea47cbdd3d317..1870bf0b4292cb3cdbc6d1744e1294fc9342088d 100755 (executable)
@@ -1,19 +1,8 @@
 #!/bin/bash
 #
-# Copyright (C) 2014 David Goulet <dgoulet@efficios.com>
+# Copyright (C) 2014 David Goulet <dgoulet@efficios.com>
 #
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+# SPDX-License-Identifier: LGPL-2.1-only
 
 TEST_DESC="Load session(s)"
 
@@ -27,7 +16,7 @@ EVENT_NAME="tp:tptest"
 
 DIR=$(readlink -f $TESTDIR)
 
-NUM_TESTS=72
+NUM_TESTS=78
 
 source $TESTDIR/utils/utils.sh
 
@@ -112,6 +101,10 @@ function test_all_load()
        destroy_lttng_session_ok $SESSION_NAME
        destroy_lttng_session_ok "$SESSION_NAME-complex"
        destroy_lttng_session_ok "$SESSION_NAME-trackers"
+       destroy_lttng_session_ok "$SESSION_NAME-maps"
+       destroy_lttng_session_ok "tracker_legacy_all"
+       destroy_lttng_session_ok "tracker_legacy_none"
+       destroy_lttng_session_ok "tracker_legacy_selective"
 
        stop_lttng_relayd
 }
@@ -140,21 +133,21 @@ function test_trackers()
                break;
        fi
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN --mi XML list "$SESSION_NAME-trackers" > $mi_output_file
-       mi_result=$($CURDIR/../mi/extract_xml -e $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:trackers/lttng:vpid_tracker/lttng:targets/lttng:vpid_target")
+       mi_result=$($CURDIR/../mi/extract_xml -e $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:process_attr_trackers/lttng:vpid_process_attr_tracker/lttng:process_attr_values/lttng:vpid")
        if [[ $mi_result = "true" ]]; then
            ok 0 "VPID target is present"
        else
            fail "VPID target missing"
        fi
 
-       mi_result=$($CURDIR/../mi/extract_xml -e $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:trackers/lttng:vuid_tracker/lttng:targets/lttng:vuid_target")
+       mi_result=$($CURDIR/../mi/extract_xml -e $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:process_attr_trackers/lttng:vuid_process_attr_tracker/lttng:process_attr_values/lttng:vuid")
        if [[ $mi_result = "true" ]]; then
            ok 0 "VUID target is present"
        else
            fail "VUID target missing"
        fi
 
-       mi_result=$($CURDIR/../mi/extract_xml -e $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:trackers/lttng:vgid_tracker/lttng:targets/lttng:vgid_target")
+       mi_result=$($CURDIR/../mi/extract_xml -e $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:process_attr_trackers/lttng:vgid_process_attr_tracker/lttng:process_attr_values/lttng:vgid")
        if [[ $mi_result = "true" ]]; then
            ok 0 "VGID target is present"
        else
@@ -172,6 +165,25 @@ function test_trackers()
        rm -f ${mi_output_file}
 }
 
+function test_maps()
+{
+       diag "Test maps loading"
+
+       lttng_load_ok "-i $CURDIR/$SESSION_NAME-maps.lttng"
+
+       local mi_output_file=$(mktemp)
+       if [ $? -ne 0 ]; then
+               break;
+       fi
+
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN --mi XML list "$SESSION_NAME-maps" > $mi_output_file
+
+       # TODO: once map information is in the MI, do some mad testing with sick xpath expressions.
+
+       destroy_lttng_session_ok "$SESSION_NAME-maps"
+       rm -f ${mi_output_file}
+}
+
 function test_override_url_normal()
 {
        local local_url_override="file:///tmp/override/to/here"
@@ -362,6 +374,7 @@ TESTS=(
        test_all_load
        test_overwrite
        test_trackers
+       test_maps
        test_override_session_name
        test_override_url_normal
        test_override_url_snapshot
This page took 0.027384 seconds and 5 git commands to generate.