@@ -949,7 +949,48 @@ def test_update_vif_xml_no_matching_vif(self):
949
949
doc = etree .fromstring (original_xml )
950
950
ex = self .assertRaises (KeyError , migration ._update_vif_xml ,
951
951
doc , data , get_vif_config )
952
- self .assertIn ("CA:FE:DE:AD:BE:EF" , str (ex ))
952
+ self .assertIn ("ca:fe:de:ad:be:ef" , str (ex ))
953
+
954
+ def test_update_vif_xml_lower_case_mac (self ):
955
+ """Tests that the vif in the migrate data is not found in the existing
956
+ guest interfaces.
957
+ """
958
+ conf = vconfig .LibvirtConfigGuestInterface ()
959
+ conf .net_type = "bridge"
960
+ conf .source_dev = "qbra188171c-ea"
961
+ conf .target_dev = "tapa188171c-ea"
962
+ conf .mac_addr = "DE:AD:BE:EF:CA:FE"
963
+ conf .model = "virtio"
964
+ original_xml = """<domain>
965
+ <uuid>3de6550a-8596-4937-8046-9d862036bca5</uuid>
966
+ <devices>
967
+ <interface type="bridge">
968
+ <mac address="de:ad:be:ef:ca:fe"/>
969
+ <model type="virtio"/>
970
+ <source bridge="qbra188171c-ea"/>
971
+ <target dev="tapa188171c-ea"/>
972
+ <virtualport type="openvswitch">
973
+ <parameters interfaceid="%s"/>
974
+ </virtualport>
975
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04'
976
+ function='0x0'/>
977
+ </interface>
978
+ </devices>
979
+ </domain>""" % uuids .ovs
980
+ expected_xml = """<domain>
981
+ <uuid>3de6550a-8596-4937-8046-9d862036bca5</uuid>
982
+ <devices>
983
+ <interface type="bridge">
984
+ <mac address="DE:AD:BE:EF:CA:FE"/>
985
+ <model type="virtio"/>
986
+ <source bridge="qbra188171c-ea"/>
987
+ <target dev="tapa188171c-ea"/>
988
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04'
989
+ function='0x0'/>
990
+ </interface>
991
+ </devices>
992
+ </domain>"""
993
+ self ._test_update_vif_xml (conf , original_xml , expected_xml )
953
994
954
995
955
996
class MigrationMonitorTestCase (test .NoDBTestCase ):
0 commit comments