How to use get_hwaddr method in avocado

Best Python code snippet using avocado_python

l2-018-bridge_fdb_team.py

Source: l2-018-bridge_fdb_team.py Github

copy

Full Screen

...25 sw_br = sw.create_bridge(slaves = [sw_lag1, sw_lag2], options=br_options)26 sleep(15)27 tl = TestLib(ctl, aliases)28 tl.ping_simple(m1_lag1, m2_lag1)29 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software")30 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")31 sleep(20)32 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)33 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)34 # Disable learning and make sure FDB is not populated.35 sw_lag1.set_br_learning(on=False, self=True)36 tl.ping_simple(m1_lag1, m2_lag1)37 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)38 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)39 # Disable flooding and make sure ping fails.40 sw_lag1.set_br_flooding(on=False, self=True)41 tl.ping_simple(m1_lag1, m2_lag1, fail_expected=True)42 # Set a static FDB entry and make sure ping works again.43 sw_lag1.add_br_fdb(str(m1_lag1.get_hwaddr()), self=True, vlan_tci=1)44 tl.ping_simple(m1_lag1, m2_lag1)45 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)46 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")47 # Remove static FDB entry. Ping should fail.48 sw_lag1.del_br_fdb(str(m1_lag1.get_hwaddr()), self=True, vlan_tci=1)49 tl.ping_simple(m1_lag1, m2_lag1, fail_expected=True)50 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)51 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)52 # Enable learning_sync and make sure both FDBs are populated.53 sw_lag1.set_br_learning(on=True, self=True)54 sw_lag1.set_br_flooding(on=True, self=True)55 sw_lag1.set_br_learning_sync(on=True, self=True)56 tl.ping_simple(m1_lag1, m2_lag1)57 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software")58 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")59 sleep(20)60 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)61 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)62 # Disable learning_sync and make sure only hardware FDB is populated.63 sw_lag1.set_br_learning_sync(on=False, self=True)64 tl.ping_simple(m1_lag1, m2_lag1)65 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)66 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")67 # Remove port from bridge and add it back. Disable flooding and learning68 # and make sure ping doesn't work. Note that port must be removed from69 # bridge when the FDB entry exists only in the hardware table. Otherwise,70 # bridge code will flush it himself, instead of driver.71 sw_br.slave_del(sw_lag1.get_id())72 sw_br.slave_add(sw_lag1.get_id()) # Enables learning sync by default.73 sw_lag1.set_br_learning(on=False, self=True)74 sw_lag1.set_br_flooding(on=False, self=True)75 tl.ping_simple(m1_lag1, m2_lag1, fail_expected=True)76 # Enable learning and make sure ping works again.77 sw_lag1.set_br_learning(on=True, self=True)78 tl.ping_simple(m1_lag1, m2_lag1)79 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software")80 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")81 sleep(20)82 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)83 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)84 # Insert a static FDB entry and disable learning sync. Ping should work.85 sw_lag1.add_br_fdb(str(m1_lag1.get_hwaddr()), self=True, vlan_tci=1)86 sw_lag1.set_br_learning_sync(on=False, self=True)87 tl.ping_simple(m1_lag1, m2_lag1)88 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)89 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")90 sleep(20)91 # Make sure static entry is not aged out.92 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)93 tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")94 # Remove port from bridge and add it back. Disable flooding and learning95 # and make sure ping doesn't work. Note that port must be removed from96 # bridge when the FDB entry exists only in the hardware table. Otherwise,97 # bridge code will flush it himself, instead of driver. Unlike the98 # previous case, here we check if the driver correctly removes the static99 # entry.100 sw_br.slave_del(sw_lag1.get_id())101 sw_br.slave_add(sw_lag1.get_id())102 sw_lag1.set_br_learning(on=False, self=True)103 sw_lag1.set_br_flooding(on=False, self=True)104 tl.ping_simple(m1_lag1, m2_lag1, fail_expected=True)105do_task(ctl, [ctl.get_host("machine1"),106 ctl.get_host("machine2"),107 ctl.get_host("switch")],...

Full Screen

Full Screen

l2-017-bridge_fdb_vlan1d.py

Source: l2-017-bridge_fdb_vlan1d.py Github

copy

Full Screen

...25 sw_br = sw.create_bridge(slaves = [sw_if1_10, sw_if2_20], options=br_options)26 sleep(15)27 tl = TestLib(ctl, aliases)28 tl.ping_simple(m1_if1_10, m2_if1_20)29 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software")30 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")31 sleep(20)32 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)33 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False)34 # Disable learning and make sure FDB is not populated.35 sw_if1_10.set_br_learning(on=False, self=True)36 tl.ping_simple(m1_if1_10, m2_if1_20)37 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)38 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False)39 # Disable flooding and make sure ping fails.40 sw_if1_10.set_br_flooding(on=False, self=True)41 tl.ping_simple(m1_if1_10, m2_if1_20, fail_expected=True)42 # Set a static FDB entry and make sure ping works again.43 sw_if1_10.add_br_fdb(str(m1_if1_10.get_hwaddr()), self=True)44 tl.ping_simple(m1_if1_10, m2_if1_20)45 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)46 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")47 # Remove static FDB entry. Ping should fail.48 sw_if1_10.del_br_fdb(str(m1_if1_10.get_hwaddr()), self=True)49 tl.ping_simple(m1_if1_10, m2_if1_20, fail_expected=True)50 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)51 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False)52 # Enable learning_sync and make sure both FDBs are populated.53 sw_if1_10.set_br_learning(on=True, self=True)54 sw_if1_10.set_br_flooding(on=True, self=True)55 sw_if1_10.set_br_learning_sync(on=True, self=True)56 tl.ping_simple(m1_if1_10, m2_if1_20)57 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software")58 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")59 sleep(20)60 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)61 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False)62 # Disable learning_sync and make sure only hardware FDB is populated.63 sw_if1_10.set_br_learning_sync(on=False, self=True)64 tl.ping_simple(m1_if1_10, m2_if1_20)65 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)66 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")67 # Remove port from bridge and add it back. Disable flooding and learning68 # and make sure ping doesn't work. Note that port must be removed from69 # bridge when the FDB entry exists only in the hardware table. Otherwise,70 # bridge code will flush it himself, instead of driver.71 sw_br.slave_del(sw_if1_10.get_id())72 sw_br.slave_add(sw_if1_10.get_id()) # Enables learning sync by default.73 sw_if1_10.set_br_learning(on=False, self=True)74 sw_if1_10.set_br_flooding(on=False, self=True)75 tl.ping_simple(m1_if1_10, m2_if1_20, fail_expected=True)76 # Enable learning and make sure ping works again.77 sw_if1_10.set_br_learning(on=True, self=True)78 tl.ping_simple(m1_if1_10, m2_if1_20)79 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software")80 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")81 sleep(20)82 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)83 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False)84 # Insert a static FDB entry and disable learning sync. Ping should work.85 sw_if1_10.add_br_fdb(str(m1_if1_10.get_hwaddr()), self=True)86 sw_if1_10.set_br_learning_sync(on=False, self=True)87 tl.ping_simple(m1_if1_10, m2_if1_20)88 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)89 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")90 sleep(20)91 # Make sure static entry is not aged out.92 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)93 tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")94 # Remove port from bridge and add it back. Disable flooding and learning95 # and make sure ping doesn't work. Note that port must be removed from96 # bridge when the FDB entry exists only in the hardware table. Otherwise,97 # bridge code will flush it himself, instead of driver. Unlike the98 # previous case, here we check if the driver correctly removes the static99 # entry.100 sw_br.slave_del(sw_if1_10.get_id())101 sw_br.slave_add(sw_if1_10.get_id())102 sw_if1_10.set_br_learning(on=False, self=True)103 sw_if1_10.set_br_flooding(on=False, self=True)104 tl.ping_simple(m1_if1_10, m2_if1_20, fail_expected=True)105do_task(ctl, [ctl.get_host("machine1"),106 ctl.get_host("machine2"),107 ctl.get_host("switch")],...

Full Screen

Full Screen

l2-002-bridge_fdb.py

Source: l2-002-bridge_fdb.py Github

copy

Full Screen

...23 sw_br = sw.create_bridge(slaves = [sw_if1, sw_if2], options=br_options)24 sleep(15)25 tl = TestLib(ctl, aliases)26 tl.ping_simple(m1_if1, m2_if1)27 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software")28 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")29 sleep(30)30# tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)31 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)32 # Disable learning and make sure FDB is not populated.33 sw_if1.set_br_learning(on=False, self=True)34 tl.ping_simple(m1_if1, m2_if1)35 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)36 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)37 # Disable flooding and make sure ping fails.38 sw_if1.set_br_flooding(on=False, self=True)39 tl.ping_simple(m1_if1, m2_if1, fail_expected=True)40 # Set a static FDB entry and make sure ping works again.41 sw_if1.add_br_fdb(str(m1_if1.get_hwaddr()), self=True, vlan_tci=1)42 tl.ping_simple(m1_if1, m2_if1)43 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)44 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")45 # Remove static FDB entry. Ping should fail.46 sw_if1.del_br_fdb(str(m1_if1.get_hwaddr()), self=True, vlan_tci=1)47 tl.ping_simple(m1_if1, m2_if1, fail_expected=True)48 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)49 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)50 # Enable learning_sync and make sure both FDBs are populated.51 sw_if1.set_br_learning(on=True, self=True)52 sw_if1.set_br_flooding(on=True, self=True)53 sw_if1.set_br_learning_sync(on=True, self=True)54 tl.ping_simple(m1_if1, m2_if1)55 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software")56 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")57 sleep(20)58 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)59 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)60 # Disable learning_sync and make sure only hardware FDB is populated.61 sw_if1.set_br_learning_sync(on=False, self=True)62 tl.ping_simple(m1_if1, m2_if1)63 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)64 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")65 # Remove port from bridge and add it back. Disable flooding and learning66 # and make sure ping doesn't work. Note that port must be removed from67 # bridge when the FDB entry exists only in the hardware table. Otherwise,68 # bridge code will flush it himself, instead of driver.69 sw_br.slave_del(sw_if1.get_id())70 sw_br.slave_add(sw_if1.get_id()) # Enables learning sync by default.71 sw_if1.set_br_learning(on=False, self=True)72 sw_if1.set_br_flooding(on=False, self=True)73 tl.ping_simple(m1_if1, m2_if1, fail_expected=True)74 # Enable learning and make sure ping works again.75 sw_if1.set_br_learning(on=True, self=True)76 tl.ping_simple(m1_if1, m2_if1)77 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software")78 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")79 sleep(20)80 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)81 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)82 # Insert a static FDB entry and disable learning sync. Ping should work.83 sw_if1.add_br_fdb(str(m1_if1.get_hwaddr()), self=True, vlan_tci=1)84 sw_if1.set_br_learning_sync(on=False, self=True)85 tl.ping_simple(m1_if1, m2_if1)86 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)87 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")88 sleep(20)89 # Make sure static entry is not aged out.90 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)91 tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")92 # Remove port from bridge and add it back. Disable flooding and learning93 # and make sure ping doesn't work. Note that port must be removed from94 # bridge when the FDB entry exists only in the hardware table. Otherwise,95 # bridge code will flush it himself, instead of driver. Unlike the96 # previous case, here we check if the driver correctly removes the static97 # entry.98 sw_br.slave_del(sw_if1.get_id())99 sw_br.slave_add(sw_if1.get_id())100 sw_if1.set_br_learning(on=False, self=True)101 sw_if1.set_br_flooding(on=False, self=True)102 tl.ping_simple(m1_if1, m2_if1, fail_expected=True)103do_task(ctl, [ctl.get_host("machine1"),104 ctl.get_host("machine2"),105 ctl.get_host("switch")],...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

Nov’22 Updates: Live With Automation Testing On OTT Streaming Devices, Test On Samsung Galaxy Z Fold4, Galaxy Z Flip4, & More

Hola Testers! Hope you all had a great Thanksgiving weekend! To make this time more memorable, we at LambdaTest have something to offer you as a token of appreciation.

Considering Agile Principles from a different angle

In addition to the four values, the Agile Manifesto contains twelve principles that are used as guides for all methodologies included under the Agile movement, such as XP, Scrum, and Kanban.

How To Choose The Best JavaScript Unit Testing Frameworks

JavaScript is one of the most widely used programming languages. This popularity invites a lot of JavaScript development and testing frameworks to ease the process of working with it. As a result, numerous JavaScript testing frameworks can be used to perform unit testing.

How To Write End-To-End Tests Using Cypress App Actions

When I started writing tests with Cypress, I was always going to use the user interface to interact and change the application’s state when running tests.

[LambdaTest Spartans Panel Discussion]: What Changed For Testing & QA Community And What Lies Ahead

The rapid shift in the use of technology has impacted testing and quality assurance significantly, especially around the cloud adoption of agile development methodologies. With this, the increasing importance of quality and automation testing has risen enough to deliver quality work.

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run avocado automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful