Parcourir la source

[master] Merge branch 'trac3651'

Marcin Siodelski il y a 10 ans
Parent
commit
6b0532bc12
2 fichiers modifiés avec 5 ajouts et 6 suppressions
  1. 1 1
      src/lib/testutils/README
  2. 4 5
      src/lib/testutils/dhcp_test_lib.sh.in

+ 1 - 1
src/lib/testutils/README

@@ -1,2 +1,2 @@
-Here is some code used by more than one test. No code is used for bind10
+Here is some code used by more than one test. No code is used for Kea
 itself, only for testing.

+ 4 - 5
src/lib/testutils/dhcp_test_lib.sh.in

@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 #
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -197,10 +197,9 @@ get_log_messages() {
     _GET_LOG_MESSAGES=0
     # If log file is not present, the number of occurrences is 0.
     if [ -s ${LOG_FILE} ]; then
-        # Grep log file for the logger message occurrences.
-        _GET_LOG_MESSAGES=$( grep -o ${msg} ${LOG_FILE} | wc -w )
-        # Remove whitespaces.
-        ${_GET_LOG_MESSAGES##*[! ]}
+        # Grep log file for the logger message occurrences and remove
+        # whitespaces, if any.
+        _GET_LOG_MESSAGES=$( grep -o ${msg} ${LOG_FILE} | wc -w | tr -d " ")
     fi
 }