]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 14 Dec 2020 07:30:36 +0000 (08:30 +0100)
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 27da2dba9b9e323bba0ee82de6407238b08fcc1e..e954bc8d254c7dc035242e3b28a337025f39203e 100644 (file)
@@ -14,12 +14,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