]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
UBUNTU: SAUCE: selftests/ftrace: Fix tab expansion in trace_marker snapshot trigger...
authorSeth Forshee <seth.forshee@canonical.com>
Fri, 25 Jan 2019 18:43:49 +0000 (12:43 -0600)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 4 Mar 2019 12:51:32 +0000 (06:51 -0600)
When trace lines are passed through echo tabs are being changed
to spaces, causing later string comparisons to fail. Add quotes
around the variables to prevent this.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc

index df246e505af7d2b82a136f06f13b4d2dc43f9427..d72b11ac13e66818a553b900d3d3689707edfe20 100644 (file)
@@ -33,12 +33,12 @@ test_trace() {
     x=$2
 
     cat $file | while read line; do
-       comment=`echo $line | sed -e 's/^#//'`
+       comment=`echo "$line" | sed -e 's/^#//'`
        if [ "$line" != "$comment" ]; then
            continue
        fi
        echo "testing $line for >$x<"
-       match=`echo $line | sed -e "s/>$x<//"`
+       match=`echo "$line" | sed -e "s/>$x<//"`
        if [ "$line" = "$match" ]; then
            fail "$line does not have >$x< in it"
        fi