def test_fail_upd_mgmt_iface_to_null_mac(): machine = sess.query(Machine).first() iface = Interface(hardware_entity=machine, name='ipmi', mac=random_mac(), bootable=True, interface_type='management') create(sess, iface) assert isinstance(iface, Interface), 'no iface created @ %s' % func_name() iface.mac = None commit(sess) assert iface.mac is not None, 'set a management iface to null mac_addr'
def test_fail_upd_bootable_iface_to_null_mac(): machine = sess.query(Machine).first() iface = Interface(hardware_entity=machine, name='eth1', mac=random_mac(), bootable=True, interface_type='public') create(sess, iface) assert isinstance(iface, Interface), 'no iface created @ %s' % func_name() iface.mac = None commit(sess) assert iface.mac is not None, 'able to set a bootable interface to null'