Shill: Shill now rebuffs connecting to service that isn't connectable.

In addtion to rebuffing non-connectable service connections, this
removes nulling-out key_management in UnloadEapCredentials.  Previously,
that method set key_management to an illegal value and this broke
subsequent connection attempts.

BUG=chromium-os:30382
TEST=Autotest 092_ProfileCredentials (not yet checked-in) and, now, unit
tests!

Change-Id: I7c2764938dda18720208f3ddf58b858d5d7e708d
Reviewed-on: https://gerrit.chromium.org/gerrit/21631
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Commit-Ready: Wade Guthrie <wdg@chromium.org>
diff --git a/wifi_service_unittest.cc b/wifi_service_unittest.cc
index b6190dd..389c717 100644
--- a/wifi_service_unittest.cc
+++ b/wifi_service_unittest.cc
@@ -336,6 +336,8 @@
                                                    false);
   EXPECT_CALL(*wifi(),
               ConnectTo(wifi_service.get(), WPASecurityArgs()));
+  Error error;
+  wifi_service->SetPassphrase("0:mumblemumblem", &error);
   wifi_service->Connect(NULL);
 }
 
@@ -352,6 +354,8 @@
                                                    false);
   EXPECT_CALL(*wifi(),
               ConnectTo(wifi_service.get(), WPASecurityArgs()));
+  Error error;
+  wifi_service->SetPassphrase("0:mumblemumblem", &error);
   wifi_service->Connect(NULL);
 }
 
@@ -368,6 +372,8 @@
                                                    false);
   EXPECT_CALL(*wifi(),
               ConnectTo(wifi_service.get(), WPASecurityArgs()));
+  Error error;
+  wifi_service->SetPassphrase("0:mumblemumblem", &error);
   wifi_service->Connect(NULL);
 }
 
@@ -384,6 +390,7 @@
                                                    false);
   Service::EapCredentials eap;
   eap.identity = "identity";
+  eap.password = "mumble";
   wifi_service->set_eap(eap);
   EXPECT_CALL(*wifi(),
               ConnectTo(wifi_service.get(), EAPSecurityArgs()));
@@ -483,6 +490,7 @@
   Service::EapCredentials eap;
   eap.key_management = "IEEE8021X";
   eap.identity = "something";
+  eap.password = "mumble";
   wifi_service->set_eap(eap);
   EXPECT_CALL(*wifi(),
               ConnectTo(wifi_service.get(), DynamicWEPArgs()));