#NEWLINE# def test_create_network_interface( self ) : #NEWLINE# #INDENT# desc = data_utils . rand_name ( 'ni' ) #NEWLINE# data = self . client . create_network_interface ( SubnetId = self . subnet_id , Description = desc ) #NEWLINE# ni_id = data [ 'NetworkInterface' ] [ 'NetworkInterfaceId' ] #NEWLINE# res_clean = self . addResourceCleanUp ( self . client . delete_network_interface , NetworkInterfaceId = ni_id ) #NEWLINE# ni = data [ 'NetworkInterface' ] #NEWLINE# self . assertEqual ( self . vpc_id , ni [ 'VpcId' ] ) #NEWLINE# self . assertEqual ( self . subnet_id , ni [ 'SubnetId' ] ) #NEWLINE# self . assertEqual ( desc , ni [ 'Description' ] ) #NEWLINE# self . assertNotEmpty ( ni . get ( 'Groups' ) ) #NEWLINE# self . assertEqual ( 'default' , ni [ 'Groups' ] [ 0 ] [ 'GroupName' ] ) #NEWLINE# address = ni . get ( 'PrivateIpAddress' ) #NEWLINE# self . assertIsNotNone ( address ) #NEWLINE# addresses = ni . get ( 'PrivateIpAddresses' ) #NEWLINE# self . assertIsNotNone ( addresses ) #NEWLINE# self . assertEqual ( 1 , len ( addresses ) ) #NEWLINE# self . assertTrue ( addresses [ 0 ] [ 'Primary' ] ) #NEWLINE# self . assertEqual ( address , addresses [ 0 ] [ 'PrivateIpAddress' ] ) #NEWLINE# self . assertIsNotNone ( ni . get ( 'MacAddress' ) ) #NEWLINE# self . assertIsNotNone ( ni . get ( 'OwnerId' ) ) #NEWLINE# self . assertIsNotNone ( ni . get ( 'RequesterManaged' ) ) #NEWLINE# self . assertIsNotNone ( ni . get ( 'SourceDestCheck' ) ) #NEWLINE# self . get_network_interface_waiter ( ) . wait_available ( ni_id ) #NEWLINE# self . client . delete_network_interface ( NetworkInterfaceId = ni_id ) #NEWLINE# self . cancelResourceCleanUp ( res_clean ) #NEWLINE# self . get_network_interface_waiter ( ) . wait_delete ( ni_id ) #NEWLINE# self . assertRaises ( 'InvalidNetworkInterfaceID.NotFound' , self . client . describe_network_interfaces , NetworkInterfaceIds = [ ni_id ] )