Best Python code snippet using autotest_python
net_utils_unittest.py
Source:net_utils_unittest.py
1#!/usr/bin/python2import unittest, os, socket, time, sys, struct3import common4from autotest_lib.client.bin import utils5from autotest_lib.client.bin.net import net_utils, net_utils_mock6from autotest_lib.client.common_lib.test_utils import mock7from autotest_lib.client.common_lib import error8class TestNetUtils(unittest.TestCase):9 class network_interface_mock(net_utils_mock.network_interface_mock):10 def __init__(self, iface='some_name', test_init=False):11 super(TestNetUtils.network_interface_mock,12 self).__init__(iface=iface, test_init=test_init)13 def setUp(self):14 self.god = mock.mock_god()15 self.god.stub_function(utils, "system")16 self.god.stub_function(utils, "system_output")17 self.god.stub_function(utils, "module_is_loaded")18 self.god.stub_function(net_utils, "open")19 self.god.stub_function(time, 'sleep')20 self.god.stub_with(net_utils,"bond", net_utils.bonding)21 self.god.stub_with(os, 'open', net_utils_mock.os_open)22 self.god.stub_with(net_utils, 'netif', net_utils_mock.netutils_netif)23 os.environ['AUTODIR'] = "autodir"24 def tearDown(self):25 self.god.unstub_all()26 del os.environ['AUTODIR']27 #28 # test network_util29 #30 def test_network_util_reset(self):31 utils.system.expect_call('service network restart', ignore_status=False)32 net_utils.network_utils().reset()33 self.god.check_playback()34 def test_network_util_start(self):35 utils.system.expect_call('service network start', ignore_status=False)36 net_utils.network_utils().start()37 self.god.check_playback()38 def test_network_util_stop(self):39 utils.system.expect_call('service network stop', ignore_status=False)40 net_utils.network_utils().stop()41 self.god.check_playback()42 def test_network_util_disable_ip_local_loopback(self):43 msg = "echo '1' > /proc/sys/net/ipv4/route/no_local_loopback"44 utils.system.expect_call(msg, ignore_status=False)45 msg = 'echo 1 > /proc/sys/net/ipv4/route/flush'46 utils.system.expect_call(msg, ignore_status=False)47 net_utils.network_utils().disable_ip_local_loopback()48 self.god.check_playback()49 def test_network_util_enable_ip_local_loopback(self):50 msg = "echo '0' > /proc/sys/net/ipv4/route/no_local_loopback"51 utils.system.expect_call(msg, ignore_status=False)52 msg = 'echo 1 > /proc/sys/net/ipv4/route/flush'53 utils.system.expect_call(msg, ignore_status=False)54 net_utils.network_utils().enable_ip_local_loopback()55 self.god.check_playback()56 #57 # test network_interface58 #59 def test_network_interface_init(self):60 self.god.stub_function(socket, 'socket')61 s = net_utils_mock.socket_stub('eth0', socket, socket)62 socket.socket.expect_call(socket.PF_PACKET,63 socket.SOCK_RAW).and_return(s)64 self.god.stub_function(s, 'bind')65 self.god.stub_function(s, 'settimeout')66 s.settimeout.expect_call(net_utils.TIMEOUT)67 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))68 mock_netif = self.network_interface_mock(iface='eth0', test_init=True)69 self.god.check_playback()70 self.assertEquals(mock_netif.ethtool, 'ethtool')71 self.assertEquals(mock_netif._name, 'eth0')72 self.assertEquals(mock_netif.was_down, 'is_down')73 self.assertEquals(mock_netif.orig_ipaddr, 'get_ipaddr')74 self.assertEquals(mock_netif.was_loopback_enabled,75 'is_loopback_enabled')76 self.assertEquals(mock_netif._socket, s)77 def test_network_interface_restore(self):78 mock_netif = self.network_interface_mock('eth0')79 mock_netif.was_loopback_enabled = False80 mock_netif.loopback_enabled = True81 mock_netif.was_down = False82 # restore using phyint83 cmd = 'ifconfig %s %s' % (mock_netif._name, mock_netif.orig_ipaddr)84 utils.system.expect_call(cmd)85 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,86 'phyint', 'disable')87 utils.system.expect_call(cmd, ignore_status=True).and_return(0)88 mock_netif.restore()89 self.god.check_playback()90 # restore using mac91 cmd = 'ifconfig %s %s' % (mock_netif._name, mock_netif.orig_ipaddr)92 utils.system.expect_call(cmd)93 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,94 'phyint', 'disable')95 utils.system.expect_call(cmd, ignore_status=True).and_return(1)96 cmd = '%s -L %s %s %s' % (mock_netif.ethtool,97 mock_netif._name, 'mac', 'disable')98 utils.system.expect_call(cmd, ignore_status=True).and_return(0)99 mock_netif.restore()100 self.god.check_playback()101 # check that down is restored102 mock_netif.was_loopback_enabled = False103 mock_netif.loopback_enabled = True104 mock_netif.was_down = True105 cmd = 'ifconfig %s %s' % (mock_netif._name, mock_netif.orig_ipaddr)106 utils.system.expect_call(cmd)107 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,108 'phyint', 'disable')109 utils.system.expect_call(cmd, ignore_status=True).and_return(0)110 cmd = 'ifconfig %s down' % mock_netif._name111 utils.system.expect_call(cmd)112 mock_netif.restore()113 self.god.check_playback()114 # check that loopback, down are done in sequence115 mock_netif.was_loopback_enabled = True116 mock_netif.loopback_enabled = True117 mock_netif.was_down = True118 cmd = 'ifconfig %s %s' % (mock_netif._name,119 mock_netif.orig_ipaddr)120 utils.system.expect_call(cmd)121 cmd = 'ifconfig %s down' % mock_netif._name122 utils.system.expect_call(cmd)123 mock_netif.restore()124 self.god.check_playback()125 # prior loopback matches current loopback126 mock_netif.was_loopback_enabled = False127 mock_netif.loopback_enabled = False128 mock_netif.was_down = True129 cmd = 'ifconfig %s %s' % (mock_netif._name,130 mock_netif.orig_ipaddr)131 utils.system.expect_call(cmd)132 cmd = 'ifconfig %s down' % mock_netif._name133 utils.system.expect_call(cmd)134 mock_netif.restore()135 self.god.check_playback()136 def test_network_interface_get_name(self):137 mock_netif = self.network_interface_mock(iface='eth0')138 self.assertEquals(mock_netif.get_name(), 'eth0')139 def test_network_interface_parse_ethtool(self):140 mock_netif = self.network_interface_mock()141 cmd = '%s %s %s' % (mock_netif.ethtool, '', mock_netif._name)142 utils.system_output.expect_call(cmd).and_return('\n field: match')143 self.assertEquals(mock_netif.parse_ethtool('field', 'some|match'),144 'match')145 self.god.check_playback()146 utils.system_output.expect_call(cmd).and_return(None)147 self.assertEquals(mock_netif.parse_ethtool('field',148 'some|match'), '')149 utils.system_output.expect_call(cmd).and_return(' field: match')150 self.assertEquals(mock_netif.parse_ethtool('field',151 'some|match'), '')152 self.god.check_playback()153 def test_network_interface_get_stats(self):154 mock_netif = self.network_interface_mock()155 self.god.stub_function(os, 'listdir')156 stat_path = '/sys/class/net/%s/statistics/' % mock_netif._name157 # no stat found158 os.listdir.expect_call(stat_path).and_return(())159 self.assertEquals(mock_netif.get_stats(), {})160 self.god.check_playback()161 # can not open stat file162 os.listdir.expect_call(stat_path).and_return(('some_stat',))163 f = self.god.create_mock_class(file, 'file')164 net_utils.open.expect_call(stat_path + 'some_stat', 'r').and_return(None)165 self.assertEquals(mock_netif.get_stats(), {})166 self.god.check_playback()167 # found a single stat168 os.listdir.expect_call(stat_path).and_return(('some_stat',))169 f = self.god.create_mock_class(file, 'file')170 net_utils.open.expect_call(stat_path + 'some_stat', 'r').and_return(f)171 f.read.expect_call().and_return(1234)172 f.close.expect_call()173 self.assertEquals(mock_netif.get_stats(), {'some_stat':1234})174 self.god.check_playback()175 # found multiple stats176 os.listdir.expect_call(stat_path).and_return(('stat1','stat2'))177 f = self.god.create_mock_class(file, 'file')178 net_utils.open.expect_call(stat_path + 'stat1', 'r').and_return(f)179 f.read.expect_call().and_return(1234)180 f.close.expect_call()181 net_utils.open.expect_call(stat_path + 'stat2', 'r').and_return(f)182 f.read.expect_call().and_return(5678)183 f.close.expect_call()184 self.assertEquals(mock_netif.get_stats(), {'stat1':1234, 'stat2':5678})185 self.god.check_playback()186 def test_network_interface_get_stats_diff(self):187 mock_netif = self.network_interface_mock()188 self.god.stub_function(os, 'listdir')189 stat_path = '/sys/class/net/%s/statistics/' % mock_netif._name190 os.listdir.expect_call(stat_path).and_return(('stat1','stat2', 'stat4'))191 f = self.god.create_mock_class(file, 'file')192 net_utils.open.expect_call(stat_path + 'stat1', 'r').and_return(f)193 f.read.expect_call().and_return(1234)194 f.close.expect_call()195 net_utils.open.expect_call(stat_path + 'stat2', 'r').and_return(f)196 f.read.expect_call().and_return(0)197 f.close.expect_call()198 net_utils.open.expect_call(stat_path + 'stat4', 'r').and_return(f)199 f.read.expect_call().and_return(10)200 f.close.expect_call()201 self.assertEquals(mock_netif.get_stats_diff({'stat1':1, 'stat2':2,202 'stat3':0}),203 {'stat1':1233, 'stat2':-2, 'stat4':10})204 self.god.check_playback()205 def test_network_interface_get_driver(self):206 mock_netif = self.network_interface_mock()207 mock_netif.get_driver = net_utils.network_interface.get_driver208 self.god.stub_function(os, 'readlink')209 stat_path = '/sys/class/net/%s/device/driver' % mock_netif._name210 os.readlink.expect_call(stat_path).and_return((211 stat_path+'/driver_name'))212 self.assertEquals(mock_netif.get_driver(mock_netif), 'driver_name')213 self.god.check_playback()214 def test_network_interface_get_carrier(self):215 mock_netif = self.network_interface_mock()216 self.god.stub_function(os, 'readlink')217 stat_path = '/sys/class/net/%s/carrier' % mock_netif._name218 f = self.god.create_mock_class(file, 'file')219 net_utils.open.expect_call(stat_path).and_return(f)220 f.read.expect_call().and_return(' 1 ')221 f.close.expect_call()222 self.assertEquals(mock_netif.get_carrier(), '1')223 self.god.check_playback()224 net_utils.open.expect_call(stat_path).and_return(f)225 f.read.expect_call().and_return(' 0 ')226 f.close.expect_call()227 self.assertEquals(mock_netif.get_carrier(), '0')228 self.god.check_playback()229 net_utils.open.expect_call(stat_path).and_return(f)230 f.read.expect_call().and_return('')231 f.close.expect_call()232 self.assertEquals(mock_netif.get_carrier(), '')233 self.god.check_playback()234 net_utils.open.expect_call(stat_path).and_return(None)235 self.assertEquals(mock_netif.get_carrier(), '')236 self.god.check_playback()237 def test_network_interface_is_autoneg_advertised(self):238 mock_netif = self.network_interface_mock()239 cmd = '%s %s %s' % (mock_netif.ethtool, '', mock_netif._name)240 utils.system_output.expect_call(cmd).and_return(241 '\n Advertised auto-negotiation: Yes')242 self.assertEquals(mock_netif.is_autoneg_advertised(), True)243 self.god.check_playback()244 utils.system_output.expect_call(cmd).and_return(245 '\n Advertised auto-negotiation: No')246 self.assertEquals(mock_netif.is_autoneg_advertised(), False)247 self.god.check_playback()248 utils.system_output.expect_call(cmd).and_return('')249 self.assertEquals(mock_netif.is_autoneg_advertised(), False)250 self.god.check_playback()251 def test_network_interface_get_speed(self):252 mock_netif = self.network_interface_mock()253 cmd = '%s %s %s' % (mock_netif.ethtool, '', mock_netif._name)254 utils.system_output.expect_call(cmd).and_return(255 '\n Speed: 1000')256 self.assertEquals(mock_netif.get_speed(), 1000)257 self.god.check_playback()258 utils.system_output.expect_call(cmd).and_return(259 '\n Speed: 10000')260 self.assertEquals(mock_netif.get_speed(), 10000)261 self.god.check_playback()262 utils.system_output.expect_call(cmd).and_return('')263 try:264 mock_netif.get_speed()265 except ValueError:266 pass267 else:268 self.assertEquals(0,1)269 self.god.check_playback()270 def test_network_interface_is_full_duplex(self):271 mock_netif = self.network_interface_mock()272 cmd = '%s %s %s' % (mock_netif.ethtool, '', mock_netif._name)273 utils.system_output.expect_call(cmd).and_return(274 '\n Duplex: Full')275 self.assertEquals(mock_netif.is_full_duplex(), True)276 self.god.check_playback()277 utils.system_output.expect_call(cmd).and_return(278 '\n Duplex: Half')279 self.assertEquals(mock_netif.is_full_duplex(), False)280 self.god.check_playback()281 utils.system_output.expect_call(cmd).and_return('')282 self.assertEquals(mock_netif.is_full_duplex(), False)283 self.god.check_playback()284 def test_network_interface_is_autoneg_on(self):285 mock_netif = self.network_interface_mock()286 cmd = '%s %s %s' % (mock_netif.ethtool, '', mock_netif._name)287 utils.system_output.expect_call(cmd).and_return(288 '\n Auto-negotiation: on')289 self.assertEquals(mock_netif.is_autoneg_on(), True)290 self.god.check_playback()291 utils.system_output.expect_call(cmd).and_return(292 '\n Auto-negotiation: off')293 self.assertEquals(mock_netif.is_autoneg_on(), False)294 self.god.check_playback()295 utils.system_output.expect_call(cmd).and_return('')296 self.assertEquals(mock_netif.is_autoneg_on(), False)297 self.god.check_playback()298 def test_network_interface_get_wakeon(self):299 mock_netif = self.network_interface_mock()300 cmd = '%s %s %s' % (mock_netif.ethtool, '', mock_netif._name)301 utils.system_output.expect_call(cmd).and_return(302 '\n Wake-on: g')303 self.assertEquals(mock_netif.get_wakeon(), 'g')304 self.god.check_playback()305 def test_network_interface_is_rx_summing_on(self):306 mock_netif = self.network_interface_mock()307 cmd = '%s %s %s' % (mock_netif.ethtool, '-k', mock_netif._name)308 utils.system_output.expect_call(cmd).and_return(309 '\n rx-checksumming: on')310 self.assertEquals(mock_netif.is_rx_summing_on(), True)311 self.god.check_playback()312 utils.system_output.expect_call(cmd).and_return(313 '\n rx-checksumming: off')314 self.assertEquals(mock_netif.is_rx_summing_on(), False)315 self.god.check_playback()316 utils.system_output.expect_call(cmd).and_return('')317 self.assertEquals(mock_netif.is_rx_summing_on(), False)318 self.god.check_playback()319 def test_network_interface_is_tx_summing_on(self):320 mock_netif = self.network_interface_mock()321 cmd = '%s %s %s' % (mock_netif.ethtool, '-k', mock_netif._name)322 utils.system_output.expect_call(cmd).and_return(323 '\n tx-checksumming: on')324 self.assertEquals(mock_netif.is_tx_summing_on(), True)325 self.god.check_playback()326 utils.system_output.expect_call(cmd).and_return(327 '\n tx-checksumming: off')328 self.assertEquals(mock_netif.is_tx_summing_on(), False)329 self.god.check_playback()330 utils.system_output.expect_call(cmd).and_return('')331 self.assertEquals(mock_netif.is_tx_summing_on(), False)332 self.god.check_playback()333 def test_network_interface_is_scatter_gather_on(self):334 mock_netif = self.network_interface_mock()335 cmd = '%s %s %s' % (mock_netif.ethtool, '-k', mock_netif._name)336 utils.system_output.expect_call(cmd).and_return(337 '\n scatter-gather: on')338 self.assertEquals(mock_netif.is_scatter_gather_on(), True)339 self.god.check_playback()340 utils.system_output.expect_call(cmd).and_return(341 '\n scatter-gather: off')342 self.assertEquals(mock_netif.is_scatter_gather_on(), False)343 self.god.check_playback()344 utils.system_output.expect_call(cmd).and_return('')345 self.assertEquals(mock_netif.is_scatter_gather_on(), False)346 self.god.check_playback()347 def test_network_interface_is_tso_on(self):348 mock_netif = self.network_interface_mock()349 cmd = '%s %s %s' % (mock_netif.ethtool, '-k', mock_netif._name)350 utils.system_output.expect_call(cmd).and_return(351 '\n tcp segmentation offload: on')352 self.assertEquals(mock_netif.is_tso_on(), True)353 self.god.check_playback()354 utils.system_output.expect_call(cmd).and_return(355 '\n tcp segmentation offload: off')356 self.assertEquals(mock_netif.is_tso_on(), False)357 self.god.check_playback()358 utils.system_output.expect_call(cmd).and_return('')359 self.assertEquals(mock_netif.is_tso_on(), False)360 self.god.check_playback()361 def test_network_interface_is_pause_autoneg_on(self):362 mock_netif = self.network_interface_mock()363 cmd = '%s %s %s' % (mock_netif.ethtool, '-a', mock_netif._name)364 utils.system_output.expect_call(cmd).and_return(365 '\n Autonegotiate: on')366 self.assertEquals(mock_netif.is_pause_autoneg_on(), True)367 self.god.check_playback()368 utils.system_output.expect_call(cmd).and_return(369 '\n Autonegotiate: off')370 self.assertEquals(mock_netif.is_pause_autoneg_on(), False)371 self.god.check_playback()372 utils.system_output.expect_call(cmd).and_return('')373 self.assertEquals(mock_netif.is_pause_autoneg_on(), False)374 self.god.check_playback()375 def test_network_interface_is_tx_pause_on(self):376 mock_netif = self.network_interface_mock()377 cmd = '%s %s %s' % (mock_netif.ethtool, '-a', mock_netif._name)378 utils.system_output.expect_call(cmd).and_return(379 '\n TX: on')380 self.assertEquals(mock_netif.is_tx_pause_on(), True)381 self.god.check_playback()382 utils.system_output.expect_call(cmd).and_return(383 '\n TX: off')384 self.assertEquals(mock_netif.is_tx_pause_on(), False)385 self.god.check_playback()386 utils.system_output.expect_call(cmd).and_return('')387 self.assertEquals(mock_netif.is_tx_pause_on(), False)388 self.god.check_playback()389 def test_network_interface_is_rx_pause_on(self):390 mock_netif = self.network_interface_mock()391 cmd = '%s %s %s' % (mock_netif.ethtool, '-a', mock_netif._name)392 utils.system_output.expect_call(cmd).and_return(393 '\n RX: on')394 self.assertEquals(mock_netif.is_rx_pause_on(), True)395 self.god.check_playback()396 utils.system_output.expect_call(cmd).and_return(397 '\n RX: off')398 self.assertEquals(mock_netif.is_rx_pause_on(), False)399 self.god.check_playback()400 utils.system_output.expect_call(cmd).and_return('')401 self.assertEquals(mock_netif.is_rx_pause_on(), False)402 self.god.check_playback()403 def test_network_interface_enable_loopback(self):404 mock_netif = self.network_interface_mock('eth0')405 mock_netif.was_loopback_enabled = False406 mock_netif.loopback_enabled = False407 mock_netif.was_down = False408 self.god.stub_function(net_utils.bonding, 'is_enabled')409 # restore using phyint410 net_utils.bonding.is_enabled.expect_call().and_return(False)411 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,412 'phyint', 'enable')413 utils.system.expect_call(cmd, ignore_status=True).and_return(0)414 mock_netif.enable_loopback()415 self.god.check_playback()416 # restore using mac417 net_utils.bonding.is_enabled.expect_call().and_return(False)418 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,419 'phyint', 'enable')420 utils.system.expect_call(cmd, ignore_status=True).and_return(1)421 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,422 'mac', 'enable')423 utils.system.expect_call(cmd, ignore_status=True).and_return(0)424 mock_netif.enable_loopback()425 self.god.check_playback()426 # catch exception on phyint and mac failures427 net_utils.bonding.is_enabled.expect_call().and_return(False)428 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,429 'phyint', 'enable')430 utils.system.expect_call(cmd, ignore_status=True).and_return(1)431 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,432 'mac', 'enable')433 utils.system.expect_call(cmd, ignore_status=True).and_return(1)434 try:435 mock_netif.enable_loopback()436 except error.TestError:437 pass438 else:439 self.assertEquals(0,1)440 self.god.check_playback()441 # catch exception on bond enabled442 net_utils.bonding.is_enabled.expect_call().and_return(True)443 try:444 mock_netif.enable_loopback()445 except error.TestError:446 pass447 else:448 self.assertEquals(0,1)449 self.god.check_playback()450 # check that setting tg3 and bnx2x driver have a sleep call451 mock_netif.driver = 'tg3'452 net_utils.bonding.is_enabled.expect_call().and_return(False)453 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,454 'phyint', 'enable')455 utils.system.expect_call(cmd, ignore_status=True).and_return(0)456 time.sleep.expect_call(1)457 mock_netif.enable_loopback()458 self.god.check_playback()459 mock_netif.driver = 'bnx2x'460 net_utils.bonding.is_enabled.expect_call().and_return(False)461 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,462 'phyint', 'enable')463 utils.system.expect_call(cmd, ignore_status=True).and_return(0)464 time.sleep.expect_call(1)465 mock_netif.enable_loopback()466 self.god.check_playback()467 def test_network_interface_disable_loopback(self):468 mock_netif = self.network_interface_mock('eth0')469 mock_netif.was_loopback_enabled = False470 mock_netif.loopback_enabled = True471 mock_netif.was_down = False472 # restore using phyint473 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,474 'phyint', 'disable')475 utils.system.expect_call(cmd, ignore_status=True).and_return(0)476 mock_netif.disable_loopback()477 self.god.check_playback()478 # restore using mac479 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,480 'phyint', 'disable')481 utils.system.expect_call(cmd, ignore_status=True).and_return(1)482 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,483 'mac', 'disable')484 utils.system.expect_call(cmd, ignore_status=True).and_return(0)485 mock_netif.disable_loopback()486 self.god.check_playback()487 # catch exception on phyint and mac failures488 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,489 'phyint', 'disable')490 utils.system.expect_call(cmd, ignore_status=True).and_return(1)491 cmd = '%s -L %s %s %s' % (mock_netif.ethtool, mock_netif._name,492 'mac', 'disable')493 utils.system.expect_call(cmd, ignore_status=True).and_return(1)494 try:495 mock_netif.disable_loopback()496 except error.TestError:497 pass498 else:499 self.assertEquals(0,1)500 self.god.check_playback()501 def test_network_interface_is_loopback_enabled(self):502 mock_netif = self.network_interface_mock('eth0')503 mock_netif.is_loopback_enabled = \504 net_utils.network_interface.is_loopback_enabled505 try:506 mock_netif.is_loopback_enabled(mock_netif)507 except error.TestError:508 pass509 else:510 self.assertEquals(0,1)511 self.god.check_playback()512 self.god.stub_function(net_utils.bonding, 'is_enabled')513 mock_netif._name = 'eth0'514 net_utils.bonding.is_enabled.expect_call().and_return(False)515 cmd = '%s -l %s' % (mock_netif.ethtool, mock_netif._name)516 utils.system_output.expect_call(cmd).and_return('')517 self.assertEquals(mock_netif.is_loopback_enabled(mock_netif), False)518 self.god.check_playback()519 for ifname in ('eth0', 'eth1', 'eth2', 'eth3', 'eth4'):520 mock_netif._name = ifname521 for bond_enable in (True, False):522 for state in (('disabled', 'disabled', 'enabled'),523 ('disabled', 'enabled', 'disabled'),524 ('enabled', 'disabled', 'disabled'),525 ('disabled', 'disabled', 'disabled')):526 net_utils.bonding.is_enabled.expect_call().and_return(527 bond_enable)528 if bond_enable:529 self.assertEquals(mock_netif.is_loopback_enabled(530 mock_netif), False)531 else:532 cmd = '%s -l %s' % (mock_netif.ethtool, mock_netif._name)533 out = 'MAC loopback is %s\n'\534 'PHY internal loopback is %s\n'\535 'PHY external loopback is %s' % (536 state[0], state[1], state[2])537 utils.system_output.expect_call(cmd).and_return(out)538 self.assertEquals(mock_netif.is_loopback_enabled(539 mock_netif), 'enabled' in state)540 self.god.check_playback()541 def test_network_interface_enable_promisc(self):542 mock_netif = self.network_interface_mock('eth0')543 cmd = 'ifconfig %s promisc' % mock_netif._name544 utils.system.expect_call(cmd)545 mock_netif.enable_promisc()546 self.god.check_playback()547 def test_network_interface_disable_promisc(self):548 mock_netif = self.network_interface_mock()549 cmd = 'ifconfig %s -promisc' % mock_netif._name550 utils.system.expect_call(cmd)551 mock_netif.disable_promisc()552 self.god.check_playback()553 def test_network_interface_get_hwaddr(self):554 mock_netif = self.network_interface_mock()555 f = self.god.create_mock_class(file, 'file')556 net_utils.open.expect_call('/sys/class/net/%s/address'557 % mock_netif._name).and_return(f)558 hw_addr = '00:0e:0c:c3:7d:a8'559 f.read.expect_call().and_return(' ' + hw_addr + ' ')560 f.close.expect_call()561 self.assertEquals(mock_netif.get_hwaddr(), hw_addr)562 self.god.check_playback()563 def test_network_interface_set_hwaddr(self):564 mock_netif = self.network_interface_mock()565 hw_addr = '00:0e:0c:c3:7d:a8'566 cmd = 'ifconfig %s hw ether %s' % (mock_netif._name,567 hw_addr)568 utils.system.expect_call(cmd)569 mock_netif.set_hwaddr(hw_addr)570 self.god.check_playback()571 def test_network_interface_add_maddr(self):572 mock_netif = self.network_interface_mock()573 maddr = '01:00:5e:00:00:01'574 cmd = 'ip maddr add %s dev %s' % (maddr, mock_netif._name)575 utils.system.expect_call(cmd)576 mock_netif.add_maddr(maddr)577 self.god.check_playback()578 def test_network_interface_del_maddr(self):579 mock_netif = self.network_interface_mock()580 maddr = '01:00:5e:00:00:01'581 cmd = 'ip maddr del %s dev %s' % (maddr, mock_netif._name)582 utils.system.expect_call(cmd)583 mock_netif.del_maddr(maddr)584 self.god.check_playback()585 def test_network_interface_get_ipaddr(self):586 mock_netif = self.network_interface_mock()587 ip_addr = '110.211.112.213'588 out_format = \589 'eth0 Link encap:Ethernet HWaddr 00:0E:0C:C3:7D:A8\n'\590 ' inet addr:%s Bcast:10.246.90.255'\591 ' Mask:255.255.255.0\n'\592 ' UP BROADCAST RUNNING MASTER MULTICAST MTU:1500'\593 ' Metric:1\n'\594 ' RX packets:463070 errors:0 dropped:0 overruns:0'\595 ' frame:0\n'\596 ' TX packets:32548 errors:0 dropped:0 overruns:0'\597 ' carrier:0\n'\598 ' collisions:0 txqueuelen:0'599 out = out_format % ip_addr600 cmd = 'ifconfig %s' % mock_netif._name601 utils.system_output.expect_call(cmd).and_return(out)602 self.assertEquals(mock_netif.get_ipaddr(), ip_addr)603 self.god.check_playback()604 cmd = 'ifconfig %s' % mock_netif._name605 utils.system_output.expect_call(cmd).and_return('some output')606 self.assertEquals(mock_netif.get_ipaddr(), '0.0.0.0')607 self.god.check_playback()608 cmd = 'ifconfig %s' % mock_netif._name609 utils.system_output.expect_call(cmd).and_return(None)610 self.assertEquals(mock_netif.get_ipaddr(), '0.0.0.0')611 self.god.check_playback()612 ip_addr = '1.2.3.4'613 out = out_format % ip_addr614 cmd = 'ifconfig %s' % mock_netif._name615 utils.system_output.expect_call(cmd).and_return(out)616 self.assertEquals(mock_netif.get_ipaddr(), ip_addr)617 self.god.check_playback()618 def test_network_interface_set_ipaddr(self):619 mock_netif = self.network_interface_mock()620 ip_addr = '1.2.3.4'621 cmd = 'ifconfig %s %s' % (mock_netif._name, ip_addr)622 utils.system.expect_call(cmd)623 mock_netif.set_ipaddr(ip_addr)624 self.god.check_playback()625 def test_network_interface_is_down(self):626 mock_netif = self.network_interface_mock()627 out_format = \628 'eth0 Link encap:Ethernet HWaddr 00:0E:0C:C3:7D:A8\n'\629 ' inet addr:1.2.3.4 Bcast:10.246.90.255'\630 ' Mask:255.255.255.0\n'\631 ' %s BROADCAST RUNNING MASTER MULTICAST MTU:1500'\632 ' Metric:1\n'\633 ' RX packets:463070 errors:0 dropped:0 overruns:0'\634 ' frame:0\n'\635 ' TX packets:32548 errors:0 dropped:0 overruns:0'\636 ' carrier:0\n'\637 ' collisions:0 txqueuelen:0'638 for state in ('UP', 'DOWN', 'NONE', ''):639 out = out_format % state640 cmd = 'ifconfig %s' % mock_netif._name641 utils.system_output.expect_call(cmd).and_return(out)642 self.assertEquals(mock_netif.is_down(), state != 'UP')643 self.god.check_playback()644 cmd = 'ifconfig %s' % mock_netif._name645 utils.system_output.expect_call(cmd).and_return(None)646 self.assertEquals(mock_netif.is_down(), False)647 self.god.check_playback()648 def test_network_interface_up(self):649 mock_netif = self.network_interface_mock()650 cmd = 'ifconfig %s up' % mock_netif._name651 utils.system.expect_call(cmd)652 mock_netif.up()653 self.god.check_playback()654 def test_network_interface_down(self):655 mock_netif = self.network_interface_mock()656 cmd = 'ifconfig %s down' % mock_netif._name657 utils.system.expect_call(cmd)658 mock_netif.down()659 self.god.check_playback()660 def test_network_interface_wait_for_carrier(self):661 mock_netif = self.network_interface_mock()662 mock_netif.wait_for_carrier = \663 net_utils.network_interface.wait_for_carrier664 f = self.god.create_mock_class(file, 'file')665 spath = '/sys/class/net/%s/carrier' % mock_netif._name666 # y = 0 - test that an exception is thrown667 # y = 1, 100 - check that carrier is checked until timeout668 for y in (0, 1, 100):669 max_timeout = y670 if y:671 for x in xrange(max_timeout - 1):672 net_utils.open.expect_call(spath).and_return(f)673 f.read.expect_call().and_return(' ' + '0' + ' ')674 f.close.expect_call()675 time.sleep.expect_call(1)676 net_utils.open.expect_call(spath).and_return(f)677 f.read.expect_call().and_return(' ' + '1' + ' ')678 f.close.expect_call()679 try:680 mock_netif.wait_for_carrier(mock_netif, max_timeout)681 except:682 pass683 else:684 if not y:685 self.assertEquals(0, 1)686 self.god.check_playback()687 def test_network_interface_send(self):688 mock_netif = self.network_interface_mock()689 mock_netif.send('test buffer')690 self.assertEquals(mock_netif._socket.send_val, 'test buffer')691 def test_network_interface_recv(self):692 mock_netif = self.network_interface_mock()693 test_str = 'test string'694 mock_netif._socket.recv_val = test_str695 rcv_str = mock_netif.recv(len(test_str))696 self.assertEquals(rcv_str, test_str)697 def test_network_interface_flush(self):698 mock_netif = self.network_interface_mock()699 self.god.stub_function(mock_netif._socket, 'close')700 mock_netif._socket.close.expect_call()701 s = self.god.create_mock_class(socket.socket, "socket")702 self.god.stub_function(socket, 'socket')703 socket.socket.expect_call(socket.PF_PACKET,704 socket.SOCK_RAW).and_return(s)705 s.settimeout.expect_call(net_utils.TIMEOUT)706 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))707 #708 # bonding tests709 #710 def test_bonding_is_enabled(self):711 try:712 net_utils.bond().is_enabled()713 except error.TestError:714 pass715 else:716 self.assertEquals(1, 0)717 def test_bonding_is_bondable(self):718 try:719 net_utils.bond().is_enabled()720 except error.TestError:721 pass722 else:723 self.assertEquals(1, 0)724 def test_bonding_enable(self):725 try:726 net_utils.bond().is_enabled()727 except error.TestError:728 pass729 else:730 self.assertEquals(1, 0)731 def test_bonding_disable(self):732 try:733 net_utils.bond().is_enabled()734 except error.TestError:735 pass736 else:737 self.assertEquals(1, 0)738 def test_bonding_get_mii_status(self):739 self.assertEquals(net_utils.bond().get_mii_status(), {})740 def test_get_mode_bonding(self):741 self.assertEquals(net_utils.bond().get_mode(), net_utils.bonding.NO_MODE)742 def test_bonding_wait_for_state_change(self):743 self.god.stub_function(utils, "ping_default_gateway")744 time.sleep.expect_call(10)745 utils.ping_default_gateway.expect_call().and_return(False)746 self.assertEquals(net_utils.bond().wait_for_state_change(), True)747 for x in xrange(9):748 time.sleep.expect_call(10)749 utils.ping_default_gateway.expect_call().and_return(True)750 time.sleep.expect_call(10)751 utils.ping_default_gateway.expect_call().and_return(False)752 self.assertEquals(net_utils.bond().wait_for_state_change(), True)753 for x in xrange(10):754 time.sleep.expect_call(10)755 utils.ping_default_gateway.expect_call().and_return(True)756 self.assertEquals(net_utils.bond().wait_for_state_change(), False)757 self.god.check_playback()758 def test_bonding_get_active_interfaces(self):759 self.assertEquals(net_utils.bond().get_active_interfaces(), [])760 self.god.check_playback()761 def test_bonding_get_slave_interfaces(self):762 self.assertEquals(net_utils.bond().get_slave_interfaces(), [])763 self.god.check_playback()764 #765 # ethernet tests766 #767 def test_ethernet_mac_string_to_binary(self):768 mac_bin = net_utils.ethernet.mac_string_to_binary('00:01:02:03:04:05')769 self.assertEqual(mac_bin, '\x00\x01\x02\x03\x04\x05')770 def test_ethernet_mac_binary_to_string(self):771 mac_str = net_utils.ethernet.mac_binary_to_string(772 '\x00\x01\x02\x03\x04\x05')773 self.assertEqual(mac_str, '00:01:02:03:04:05')774 def test_ethernet_pack(self):775 dst = net_utils.ethernet.mac_string_to_binary('00:01:02:03:04:05')776 src = net_utils.ethernet.mac_string_to_binary('16:17:18:19:1A:1B')777 protocol = 2030778 payload = 'some payload'779 frame = struct.pack("!6s6sH", dst, src, protocol) + payload780 self.assertEquals(net_utils.ethernet.pack(dst, src,protocol, payload),781 frame)782 def test_ethernet_unpack(self):783 dst = net_utils.ethernet.mac_string_to_binary('00:01:02:03:04:05')784 src = net_utils.ethernet.mac_string_to_binary('16:17:18:19:1A:1B')785 protocol = 2030786 payload = 'some payload'787 frame = net_utils.ethernet.pack(dst, src, protocol, payload)788 uframe = net_utils.ethernet.unpack(frame)789 self.assertEquals(uframe[net_utils.ethernet.FRAME_KEY_DST_MAC], dst)790 self.assertEquals(uframe[net_utils.ethernet.FRAME_KEY_SRC_MAC], src)791 self.assertEquals(uframe[net_utils.ethernet.FRAME_KEY_PROTO], protocol)792 self.assertEquals(uframe[net_utils.ethernet.FRAME_KEY_PAYLOAD], payload)793 # raw_socket tests794 #795 def test_raw_socket_open(self):796 self.god.stub_function(socket, 'setdefaulttimeout')797 s = self.god.create_mock_class(socket.socket, "socket")798 self.god.stub_function(socket, 'socket')799 # open without a protocol800 socket.setdefaulttimeout.expect_call(1)801 socket.socket.expect_call(socket.PF_PACKET,802 socket.SOCK_RAW).and_return(s)803 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))804 s.settimeout.expect_call(1)805 sock = net_utils.raw_socket('eth0')806 sock.open(protocol=None)807 self.god.check_playback()808 # double open should throw an exception809 try:810 sock.open()811 except error.TestError:812 pass813 else:814 self.assertEquals(1, 0)815 self.god.check_playback()816 # open a protocol817 socket.setdefaulttimeout.expect_call(1)818 socket.socket.expect_call(socket.PF_PACKET,819 socket.SOCK_RAW,820 socket.htons(1234)).and_return(s)821 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))822 s.settimeout.expect_call(1)823 sock = net_utils.raw_socket('eth0')824 sock.open(protocol=1234)825 self.god.check_playback()826 def test_raw_socket_close(self):827 self.god.stub_function(socket, 'setdefaulttimeout')828 s = self.god.create_mock_class(socket.socket, "socket")829 self.god.stub_function(socket, 'socket')830 # close without open831 socket.setdefaulttimeout.expect_call(1)832 sock = net_utils.raw_socket('eth0')833 try:834 sock.close()835 except error.TestError:836 pass837 else:838 self.assertEquals(1, 0)839 # close after open840 socket.setdefaulttimeout.expect_call(1)841 socket.socket.expect_call(socket.PF_PACKET,842 socket.SOCK_RAW).and_return(s)843 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))844 s.settimeout.expect_call(1)845 sock = net_utils.raw_socket('eth0')846 sock.open(protocol=None)847 s.close.expect_call()848 sock.close()849 self.god.check_playback()850 def test_raw_socket_recv(self):851 self.god.stub_function(socket, 'setdefaulttimeout')852 self.god.create_mock_class(socket.socket, "socket")853 self.god.stub_function(socket, 'socket')854 # rcv without open855 socket.setdefaulttimeout.expect_call(1)856 sock = net_utils.raw_socket('eth0')857 try:858 sock.recv(10)859 except error.TestError:860 pass861 else:862 self.assertEquals(1, 0)863 self.god.check_playback()864 # open a protocol and try to get packets of varying sizes865 # I could not get socket.recv to get a mock expect_call. To keep866 # on going, added a socket stub867 s = net_utils_mock.socket_stub('eth0', socket, socket)868 socket.socket.expect_call(socket.PF_PACKET,869 socket.SOCK_RAW,870 socket.htons(1234)).and_return(s)871 self.god.stub_function(s, 'bind')872 self.god.stub_function(s, 'settimeout')873 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))874 s.settimeout.expect_call(1)875 sock.open(protocol=1234)876 s.recv_val = ''877 self.assertEquals(sock.recv(1), (None, 0))878 s.recv_val = '\xFF' * (net_utils.ethernet.ETH_PACKET_MIN_SIZE-5)879 self.assertEquals(sock.recv(1), (None, 0))880 # when receiving a packet, make sure the timeout is not change881 s.recv_val = '\xEE' * (net_utils.ethernet.ETH_PACKET_MIN_SIZE-4)882 self.assertEquals(sock.recv(1), (s.recv_val, 1))883 s.recv_val = '\xDD' * (net_utils.ethernet.ETH_PACKET_MIN_SIZE)884 self.assertEquals(sock.recv(1), (s.recv_val, 1))885 s.recv_val = '\xCC' * (net_utils.ethernet.ETH_PACKET_MAX_SIZE)886 self.assertEquals(sock.recv(1), (s.recv_val, 1))887 s.recv_val = '\xBB' * (net_utils.ethernet.ETH_PACKET_MAX_SIZE+1)888 packet, time_left = sock.recv(1)889 self.assertEquals(len(packet), net_utils.ethernet.ETH_PACKET_MAX_SIZE)890 self.assertEquals(packet,891 s.recv_val[:net_utils.ethernet.ETH_PACKET_MAX_SIZE])892 # test timeout893 s.recv_val = ''894 s.throw_timeout = False895 sock.recv(5)896 self.assertEquals(sock.recv(1), (None, 0))897 s.throw_timeout = True898 sock.recv(5)899 self.assertEquals(sock.recv(1), (None, 0))900 self.god.check_playback()901 def test_raw_socket_send(self):902 self.god.stub_function(socket, 'setdefaulttimeout')903 self.god.create_mock_class(socket.socket, "socket")904 self.god.stub_function(socket, 'socket')905 self.god.stub_function(socket, 'send')906 # send without open907 socket.setdefaulttimeout.expect_call(1)908 sock = net_utils.raw_socket('eth0')909 try:910 sock.send('test this packet')911 except error.TestError:912 pass913 else:914 self.assertEquals(1, 0)915 self.god.check_playback()916 # open a protocol and try to send a packet917 s = net_utils_mock.socket_stub('eth0', socket, socket)918 self.god.stub_function(s, 'bind')919 self.god.stub_function(s, 'settimeout')920 socket.socket.expect_call(socket.PF_PACKET,921 socket.SOCK_RAW,922 socket.htons(1234)).and_return(s)923 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))924 s.settimeout.expect_call(1)925 packet = '\xFF\xAA\xBB\xCC\xDD\x11packet data\x00\x00'926 s.send.expect_call(packet)927 sock.open(protocol=1234)928 sock.send(packet)929 self.god.check_playback()930 def test_raw_socket_send_to(self):931 self.god.stub_function(socket, 'setdefaulttimeout')932 self.god.create_mock_class(socket.socket, "socket")933 self.god.stub_function(socket, 'socket')934 self.god.stub_function(socket, 'send')935 # send without open936 socket.setdefaulttimeout.expect_call(1)937 sock = net_utils.raw_socket('eth0')938 try:939 sock.send_to('0', '1', 1, 'test this packet')940 except error.TestError:941 pass942 else:943 self.assertEquals(1, 0)944 self.god.check_playback()945 # open a protocol and try to send a packet946 s = net_utils_mock.socket_stub('eth0', socket, socket)947 self.god.stub_function(s, 'bind')948 self.god.stub_function(s, 'settimeout')949 socket.socket.expect_call(socket.PF_PACKET,950 socket.SOCK_RAW,951 socket.htons(1234)).and_return(s)952 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))953 s.settimeout.expect_call(1)954 packet = '\x00\x00packet data\x00\x00'955 s.send.expect_call(packet)956 sock.open(protocol=1234)957 try:958 sock.send_to(None, None, 1, packet)959 except error.TestError:960 pass961 else:962 self.assertEquals(1, 0)963 self.god.check_playback()964 dst_mac = '\x00\x01\x02\x03\x04\x05'965 src_mac = '\xFF\xEE\xDD\xCC\xBB\xAA'966 protocol = 1234967 s.send.expect_call(dst_mac+src_mac+'%d'%protocol+packet)968 sock.send_to(dst_mac, src_mac, protocol, packet)969 self.god.check_playback()970 def test_raw_socket_recv_from(self):971 def __set_clock(sock):972 time.clock.expect_call().and_return(0.0)973 time.clock.expect_call().and_return(0.0)974 time.clock.expect_call().and_return(float(sock.socket_timeout()) + 0.5)975 self.god.stub_function(socket, 'setdefaulttimeout')976 self.god.create_mock_class(socket.socket, "socket")977 self.god.stub_function(socket, 'socket')978 # rcv without open979 socket.setdefaulttimeout.expect_call(1)980 sock = net_utils.raw_socket('eth0')981 try:982 sock.recv_from(None, None, None)983 except error.TestError:984 pass985 else:986 self.assertEquals(1, 0)987 self.god.check_playback()988 # open a protocol and try to get packets of varying sizes989 # I could not get socket.recv to get a mock expect_call. To keep990 # on going, added a socket stub991 s = net_utils_mock.socket_stub('eth0', socket, socket)992 socket.socket.expect_call(socket.PF_PACKET,993 socket.SOCK_RAW,994 socket.htons(1234)).and_return(s)995 self.god.stub_function(s, 'bind')996 self.god.stub_function(s, 'settimeout')997 s.bind.expect_call(('eth0', net_utils.raw_socket.ETH_P_ALL))998 s.settimeout.expect_call(1)999 sock.open(protocol=1234)1000 s.recv_val = ''1001 dst_mac = net_utils.ethernet.mac_string_to_binary('00:01:02:03:04:05')1002 src_mac = net_utils.ethernet.mac_string_to_binary('16:17:18:19:1A:1B')1003 t_mac = net_utils.ethernet.mac_string_to_binary('E6:E7:E8:E9:EA:EB')1004 protocol = 20301005 t_protocol = 12341006 data = '\xEE' * (net_utils.ethernet.ETH_PACKET_MIN_SIZE)1007 # no data to receive at socket1008 self.assertEquals(sock.recv_from(None, None, None), None)1009 self.assertEquals(sock.recv_from(dst_mac, None, None), None)1010 self.assertEquals(sock.recv_from(None, src_mac, None), None)1011 self.assertEquals(sock.recv_from(None, None, protocol), None)1012 # receive packet < min size1013 s.recv_val = (struct.pack("!6s6sH", dst_mac, src_mac, protocol) +1014 'packet_to_short')1015 self.assertEquals(sock.recv_from(None, None, None), None)1016 # receive packet, filtering on mac address and protocol1017 s.recv_val = struct.pack("!6s6sH", dst_mac, t_mac, t_protocol) + data1018 frame = net_utils.ethernet.unpack(s.recv_val)1019 self.assertEquals(sock.recv_from(None, None, None), frame)1020 self.assertEquals(sock.recv_from(dst_mac, None, None), frame)1021 # use time clock to speed up the timeout in send_to()1022 self.god.stub_function(time, 'clock')1023 __set_clock(sock)1024 self.assertEquals(sock.recv_from(dst_mac, src_mac, None), None)1025 __set_clock(sock)1026 self.assertEquals(sock.recv_from(dst_mac, None, protocol), None)1027 __set_clock(sock)1028 self.assertEquals(sock.recv_from(dst_mac, src_mac, protocol), None)1029 self.god.unstub(time, 'clock')1030 s.recv_val = struct.pack("!6s6sH", dst_mac, src_mac, protocol) + data1031 frame = net_utils.ethernet.unpack(s.recv_val)1032 self.assertEquals(sock.recv_from(dst_mac, None, None), frame)1033 self.assertEquals(sock.recv_from(dst_mac, src_mac, None), frame)1034 self.assertEquals(sock.recv_from(dst_mac, src_mac, protocol), frame)1035 self.assertEquals(sock.recv_from(None, None, protocol), frame)1036 self.assertEquals(sock.recv_from(None, src_mac, None), frame)1037 self.god.stub_function(time, 'clock')1038 __set_clock(sock)1039 self.assertEquals(sock.recv_from(None, None, t_protocol), None)1040 __set_clock(sock)1041 self.assertEquals(sock.recv_from(None, t_mac, None), None)1042 self.god.unstub(time, 'clock')1043 self.god.check_playback()1044if __name__ == "__main__":...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!