shill: log non-zero exit by dhcpcd at higher priority

We've seen some cases where dhcpcd starts up, but never sends any
packets out. It's possible that dhcpcd is exiting in those cases.
But we don't know, because we log the exit status with SLOG.

Non-zero exit should (probably) be rare. So log those at WARNING
instead of using SLOG.

BUG=chromium-os:37003
TEST=unit tests

Change-Id: I650c721e208cf132258b8d46b797f735e3bdde9d
Reviewed-on: https://gerrit.chromium.org/gerrit/39337
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/dhcp_config_unittest.cc b/dhcp_config_unittest.cc
index dc7bb00..2654a70 100644
--- a/dhcp_config_unittest.cc
+++ b/dhcp_config_unittest.cc
@@ -17,6 +17,7 @@
 #include "shill/mock_control.h"
 #include "shill/mock_dhcp_proxy.h"
 #include "shill/mock_glib.h"
+#include "shill/mock_log.h"
 #include "shill/mock_minijail.h"
 #include "shill/property_store_unittest.h"
 #include "shill/proxy_factory.h"
@@ -159,7 +160,10 @@
 
 void DHCPConfigTest::StopRunningConfigAndExpect(DHCPConfigRefPtr config,
                                                 bool lease_file_exists) {
-  DHCPConfig::ChildWatchCallback(kPID, 0, config.get());
+  ScopedMockLog log;
+  // We use a non-zero exit status so that we get the log message.
+  EXPECT_CALL(log, Log(_, _, ::testing::EndsWith("status 10")));
+  DHCPConfig::ChildWatchCallback(kPID, 10, config.get());
   EXPECT_EQ(NULL, DHCPProvider::GetInstance()->GetConfig(kPID).get());
 
   EXPECT_FALSE(file_util::PathExists(pid_file_));