libvirt: add a test to guard against set_host_enabled raising an error
libvirt: add a test to guard against set_host_enabled raising an error

Commit cc70e3a adds a finally block to _get_new_connection to
automatically disable the host if making a connection to libvirt fails.

The set_host_enabled method currently swallows all exceptions which is
good so it doesn't mask the original libvirt failure in
_get_new_connection, but we need to have a test that makes sure that
isn't unintentionally regressed. This patch adds the test.

Related-Bug: #1257644

Change-Id: I4beec053794edc75ef2d0060a05285f7ed0b99ac

akash1808/nova,MountainWei/nova,edulramirez/nova,Yusuke1987/openstack_template,tudorvio/nova,petrutlucian94/nova_dev,ruslanloman/nova,phenoxim/nova,gooddata/openstack-nova,TwinkleChawla/nova,mandeepdhami/nova,devoid/nova,ruslanloman/nova,shahar-stratoscale/nova,scripnichenko/nova,vladikr/nova_drafts,Stavitsky/nova,double12gzh/nova,tangfeixiong/nova,mgagne/nova,mmnelemane/nova,orbitfp7/nova,viggates/nova,ted-gould/nova,bgxavier/nova,leilihh/novaha,klmitch/nova,cloudbase/nova,hanlind/nova,MountainWei/nova,klmitch/nova,watonyweng/nova,thomasem/nova,redhat-openstack/nova,takeshineshiro/nova,zaina/nova,petrutlucian94/nova,noironetworks/nova,projectcalico/calico-nova,tianweizhang/nova,berrange/nova,alexandrucoman/vbox-nova-driver,Tehsmash/nova,rrader/nova-docker-plugin,felixma/nova,eharney/nova,JioCloud/nova,devendermishrajio/nova_test_latest,mikalstill/nova,rahulunair/nova,JianyuWang/nova,sebrandon1/nova,jianghuaw/nova,sebrandon1/nova,mmnelemane/nova,angdraug/nova,silenceli/nova,adelina-t/nova,devendermishrajio/nova_test_latest,CCI-MOC/nova,CloudServer/nova,barnsnake351/nova,scripnichenko/nova,bigswitch/nova,phenoxim/nova,j-carpentier/nova,vmturbo/nova,JioCloud/nova,devendermishrajio/nova,yatinkumbhare/openstack-nova,akash1808/nova_test_latest,apporc/nova,akash1808/nova_test_latest,petrutlucian94/nova,leilihh/novaha,double12gzh/nova,gooddata/openstack-nova,nikesh-mahalka/nova,tangfeixiong/nova,alvarolopez/nova,jianghuaw/nova,alexandrucoman/vbox-nova-driver,thomasem/nova,eayunstack/nova,dawnpower/nova,ted-gould/nova,tealover/nova,cyx1231st/nova,mahak/nova,kimjaejoong/nova,Stavitsky/nova,whitepages/nova,jianghuaw/nova,OpenAcademy-OpenStack/nova-scheduler,LoHChina/nova,noironetworks/nova,watonyweng/nova,cloudbase/nova,belmiromoreira/nova,affo/nova,tudorvio/nova,tanglei528/nova,eonpatapon/nova,fnordahl/nova,rajalokan/nova,eharney/nova,rahulunair/nova,mahak/nova,hanlind/nova,jeffrey4l/nova,openstack/nova,CiscoSystems/nova,OpenAcademy-OpenStack/nova-scheduler,Juniper/nova,Juniper/nova,petrutlucian94/nova_dev,redhat-openstack/nova,yosshy/nova,viggates/nova,zhimin711/nova,Francis-Liu/animated-broccoli,rahulunair/nova,zhimin711/nova,Metaswitch/calico-nova,yatinkumbhare/openstack-nova,CEG-FYP-OpenStack/scheduler,luogangyi/bcec-nova,j-carpentier/nova,luogangyi/bcec-nova,mikalstill/nova,cyx1231st/nova,iuliat/nova,cloudbase/nova-virtualbox,virtualopensystems/nova,CiscoSystems/nova,Francis-Liu/animated-broccoli,Juniper/nova,BeyondTheClouds/nova,spring-week-topos/nova-week,vmturbo/nova,isyippee/nova,silenceli/nova,varunarya10/nova_test_latest,barnsnake351/nova,mgagne/nova,jeffrey4l/nova,openstack/nova,cernops/nova,ewindisch/nova,mandeepdhami/nova,LoHChina/nova,spring-week-topos/nova-week,sebrandon1/nova,orbitfp7/nova,Tehsmash/nova,alaski/nova,joker946/nova,adelina-t/nova,raildo/nova,badock/nova,eonpatapon/nova,kimjaejoong/nova,shail2810/nova,nikesh-mahalka/nova,projectcalico/calico-nova,BeyondTheClouds/nova,takeshineshiro/nova,shahar-stratoscale/nova,dawnpower/nova,JioCloud/nova_test_latest,cernops/nova,felixma/nova,vladikr/nova_drafts,klmitch/nova,devendermishrajio/nova,NeCTAR-RC/nova,maelnor/nova,tealover/nova,CCI-MOC/nova,rajalokan/nova,saleemjaveds/https-github.com-openstack-nova,tianweizhang/nova,virtualopensystems/nova,rajalokan/nova,raildo/nova,hanlind/nova,tanglei528/nova,leilihh/nova,sacharya/nova,angdraug/nova,bigswitch/nova,blueboxgroup/nova,gooddata/openstack-nova,devoid/nova,iuliat/nova,belmiromoreira/nova,bgxavier/nova,vmturbo/nova,affo/nova,Metaswitch/calico-nova,berrange/nova,dims/nova,openstack/nova,whitepages/nova,zzicewind/nova,TwinkleChawla/nova,rrader/nova-docker-plugin,jianghuaw/nova,blueboxgroup/nova,Yusuke1987/openstack_template,CloudServer/nova,akash1808/nova,gooddata/openstack-nova,JioCloud/nova_test_latest,varunarya10/nova_test_latest,mikalstill/nova,JianyuWang/nova,mahak/nova,alaski/nova,apporc/nova,badock/nova,zaina/nova,yosshy/nova,rajalokan/nova,dims/nova,ewindisch/nova,saleemjaveds/https-github.com-openstack-nova,NeCTAR-RC/nova,zzicewind/nova,Juniper/nova,isyippee/nova,klmitch/nova,leilihh/nova,BeyondTheClouds/nova,edulramirez/nova,maelnor/nova,cloudbase/nova-virtualbox,cernops/nova,eayunstack/nova,fnordahl/nova,sacharya/nova,alvarolopez/nova,CEG-FYP-OpenStack/scheduler,joker946/nova,cloudbase/nova,shail2810/nova,vmturbo/nova