How to use exit_code method in autotest

Best Python code snippet using autotest_python

alignak-backend-cli-tests.py

Source:alignak-backend-cli-tests.py Github

copy

Full Screen

1#!/usr/bin/env python2# -*- coding: utf-8 -*-3"""4 Tests for the alignak-backend-cli script5"""6from __future__ import print_function7import os8import shlex9import subprocess10import time11import unittest212# import alignak_backend_client.backend_client13#14# Set coverage test mode...15os.environ['COVERAGE_PROCESS_START'] = '1'16class TestAlignakBackendCli(unittest2.TestCase):17 """Test class for alignak-backend-cli"""18 @classmethod19 def setUpClass(cls):20 """Prepare the Alignak backend"""21 print("Start alignak backend")22 cls.backend_address = "http://localhost:5000"23 # Set DB name for tests24 os.environ['ALIGNAK_BACKEND_MONGO_DBNAME'] = 'alignak-backend-cli-test'25 # Delete used mongo DBs26 exit_code = subprocess.call(27 shlex.split(28 'mongo %s --eval "db.dropDatabase()"' % os.environ['ALIGNAK_BACKEND_MONGO_DBNAME'])29 )30 assert exit_code == 031 cls.pid = subprocess.Popen([32 'uwsgi', '--plugin', 'python', '-w', 'alignakbackend:app',33 '--socket', '0.0.0.0:5000', '--protocol=http', '--enable-threads', '--pidfile',34 '/tmp/uwsgi.pid'35 ])36 time.sleep(3)37 @classmethod38 def tearDownClass(cls):39 """40 Stop the backend at the end of the tests41 :param module:42 :return: None43 """44 print("Stop alignak backend")45 cls.pid.kill()46 def test_start_00_errors(self):47 # pylint: disable=no-self-use48 """ Start CLI without parameters or erroneous parameters"""49 print('test application default start')50 print("Coverage env: %s" % os.environ.get('COV_CORE_SOURCE', 'unknown'))51 fnull = open(os.devnull, 'w')52 print("Launching application without parameters...")53 # from alignak_backend_client.backend_client import main54 # print("Main: %s" % main())55 exit_code = subprocess.call(56 shlex.split('python ../alignak_backend_client/backend_client.py')57 )58 assert exit_code == 6459 print("Launching application with erroneous parameters...")60 exit_code = subprocess.call(61 shlex.split('python ../alignak_backend_client/backend_client.py -Z')62 )63 assert exit_code == 6464 exit_code = subprocess.call(65 shlex.split('python ../alignak_backend_client/backend_client.py -t realm unknown_action')66 )67 assert exit_code == 6468 exit_code = subprocess.call(69 shlex.split('python ../alignak_backend_client/backend_client.py -b http://mybackend -t realm list')70 )71 assert exit_code == 172 exit_code = subprocess.call(73 shlex.split('python ../alignak_backend_client/backend_client.py -b http://127.0.0.1:5000 -u fake -p faka -t realm list')74 )75 assert exit_code == 176 def test_start_00_help(self):77 # pylint: disable=no-self-use78 """ Start CLI with help parameter"""79 print("Launching application with CLI help...")80 exit_code = subprocess.call(81 shlex.split('python ../alignak_backend_client/backend_client.py -h')82 )83 assert exit_code == 084 def test_start_00_quiet_verbose(self):85 # pylint: disable=no-self-use86 """ Start CLI with quiet/verbose mode"""87 # Quiet mode88 exit_code = subprocess.call(shlex.split(89 'python ../alignak_backend_client/backend_client.py -f "/tmp" -t realm -q list'90 ))91 assert exit_code == 092 # Verbosemode93 exit_code = subprocess.call(shlex.split(94 'python ../alignak_backend_client/backend_client.py -f "/tmp" -t realm -v list'95 ))96 assert exit_code == 097 def test_start_01_get_default(self):98 # pylint: disable=no-self-use99 """ CLI to get default backend objects"""100 # work_dir = os.path.abspath(os.path.dirname(__file__))101 work_dir = '/tmp'102 files = ['alignak-object-list-realms.json',103 'alignak-object-list-commands.json',104 'alignak-object-list-timeperiods.json',105 'alignak-object-list-usergroups.json',106 'alignak-object-list-hostgroups.json',107 'alignak-object-list-servicegroups.json',108 'alignak-model-list-users.json',109 'alignak-model-list-hosts.json',110 'alignak-model-list-services.json',111 'alignak-object-list-users.json',112 'alignak-object-list-hosts.json',113 'alignak-object-list-services.json']114 for filename in files:115 if os.path.exists(os.path.join(work_dir, filename)):116 os.remove(os.path.join(work_dir, filename))117 print("Getting the backend default elements...")118 exit_code = subprocess.call(shlex.split(119 'python ../alignak_backend_client/backend_client.py -f "%s" -t realm list' % work_dir120 ))121 assert exit_code == 0122 exit_code = subprocess.call(shlex.split(123 'python ../alignak_backend_client/backend_client.py -f "%s" -t command list' % work_dir124 ))125 assert exit_code == 0126 exit_code = subprocess.call(shlex.split(127 'python ../alignak_backend_client/backend_client.py -f "%s" -t timeperiod list' % work_dir128 ))129 assert exit_code == 0130 exit_code = subprocess.call(shlex.split(131 'python ../alignak_backend_client/backend_client.py -f "%s" -t usergroup list' % work_dir132 ))133 assert exit_code == 0134 exit_code = subprocess.call(shlex.split(135 'python ../alignak_backend_client/backend_client.py -f "%s" -t hostgroup list' % work_dir136 ))137 assert exit_code == 0138 exit_code = subprocess.call(shlex.split(139 'python ../alignak_backend_client/backend_client.py -f "%s" -t servicegroup list' % work_dir140 ))141 assert exit_code == 0142 exit_code = subprocess.call(shlex.split(143 'python ../alignak_backend_client/backend_client.py -f "%s" -t user -m list' % work_dir144 ))145 assert exit_code == 0146 exit_code = subprocess.call(shlex.split(147 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -m list' % work_dir148 ))149 assert exit_code == 0150 exit_code = subprocess.call(shlex.split(151 'python ../alignak_backend_client/backend_client.py -f "%s" -t service -m list' % work_dir152 ))153 assert exit_code == 0154 exit_code = subprocess.call(shlex.split(155 'python ../alignak_backend_client/backend_client.py -f "%s" -t user list' % work_dir156 ))157 assert exit_code == 0158 exit_code = subprocess.call(shlex.split(159 'python ../alignak_backend_client/backend_client.py -f "%s" -t host list' % work_dir160 ))161 assert exit_code == 0162 exit_code = subprocess.call(shlex.split(163 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list' % work_dir164 ))165 assert exit_code == 0166 for filename in files:167 print("Exists %s?" % filename)168 assert os.path.exists(os.path.join(work_dir, filename))169 def test_start_02_create(self):170 # pylint: disable=no-self-use171 """ CLI to create backend objects"""172 work_dir = os.path.abspath(os.path.dirname(__file__))173 work_dir = os.path.join(work_dir, 'json')174 print("Creating backend elements...")175 # Create commands176 exit_code = subprocess.call(shlex.split(177 'python ../alignak_backend_client/backend_client.py -f "%s" -t command -d checks-pack-commands.json add' % work_dir178 ))179 assert exit_code == 0180 # Create templates181 exit_code = subprocess.call(shlex.split(182 'python ../alignak_backend_client/backend_client.py -f "%s" -t user -d checks-pack-users-templates.json add' % work_dir183 ))184 assert exit_code == 0185 exit_code = subprocess.call(shlex.split(186 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d checks-pack-hosts-templates.json add' % work_dir187 ))188 assert exit_code == 0189 exit_code = subprocess.call(shlex.split(190 'python ../alignak_backend_client/backend_client.py -f "%s" -t service -d checks-pack-services-templates.json add' % work_dir191 ))192 assert exit_code == 0193 # Create a realm194 # First, dry-run ... it will not create!195 exit_code = subprocess.call(shlex.split(196 'python ../alignak_backend_client/backend_client.py -t realm -c add test_realm'197 ))198 assert exit_code == 0199 # Then we create :)200 exit_code = subprocess.call(shlex.split(201 'python ../alignak_backend_client/backend_client.py -t realm add test_realm'202 ))203 assert exit_code == 0204 # Already exists!205 exit_code = subprocess.call(shlex.split(206 'python ../alignak_backend_client/backend_client.py -t realm add test_realm'207 ))208 assert exit_code == 2209 # Create hosts210 # First, dry-run ... it will not create!211 exit_code = subprocess.call(shlex.split(212 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -c add host_without_template' % work_dir213 ))214 assert exit_code == 0215 # Then we create :)216 exit_code = subprocess.call(shlex.split(217 'python ../alignak_backend_client/backend_client.py -f "%s" -t host add host_without_template' % work_dir218 ))219 assert exit_code == 0220 # Already exists!221 exit_code = subprocess.call(shlex.split(222 'python ../alignak_backend_client/backend_client.py -f "%s" -t host add host_without_template' % work_dir223 ))224 assert exit_code == 2225 exit_code = subprocess.call(shlex.split(226 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -T windows-passive-host add host_test' % work_dir227 ))228 assert exit_code == 0229 exit_code = subprocess.call(shlex.split(230 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d example_host_data.json add host_test_2' % work_dir231 ))232 assert exit_code == 0233 exit_code = subprocess.call(shlex.split(234 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d example_host_from_template.json add host_test_3' % work_dir235 ))236 assert exit_code == 0237 # Get hosts and services lists238 # All the hosts (implicit default value)239 exit_code = subprocess.call(shlex.split(240 'python ../alignak_backend_client/backend_client.py -f "%s" list' % work_dir241 ))242 assert exit_code == 0243 # All the hosts244 exit_code = subprocess.call(shlex.split(245 'python ../alignak_backend_client/backend_client.py -f "%s" -t host list' % work_dir246 ))247 assert exit_code == 0248 # Embed the linked resources249 exit_code = subprocess.call(shlex.split(250 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -e list' % work_dir251 ))252 assert exit_code == 0253 # A specific host254 exit_code = subprocess.call(shlex.split(255 'python ../alignak_backend_client/backend_client.py -f "%s" -t host get host_test' % work_dir256 ))257 assert exit_code == 0258 exit_code = subprocess.call(shlex.split(259 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -e get host_test' % work_dir260 ))261 assert exit_code == 0262 # A specific host and its services in the same output263 exit_code = subprocess.call(shlex.split(264 'python ../alignak_backend_client/backend_client.py -f "%s" -t host get host_test/*' % work_dir265 ))266 assert exit_code == 0267 exit_code = subprocess.call(shlex.split(268 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -e get host_test/*' % work_dir269 ))270 assert exit_code == 0271 # A specific host service272 exit_code = subprocess.call(shlex.split(273 'python ../alignak_backend_client/backend_client.py -f "%s" -t service get host_test/nsca_services' % work_dir274 ))275 assert exit_code == 0276 # All the services277 exit_code = subprocess.call(shlex.split(278 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list' % work_dir279 ))280 assert exit_code == 0281 # The services of the host host_test282 exit_code = subprocess.call(shlex.split(283 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list host_test/*' % work_dir284 ))285 assert exit_code == 0286 # The services of an unknown host287 exit_code = subprocess.call(shlex.split(288 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list host_unknown/*' % work_dir289 ))290 assert exit_code == 2291 # A specific service of the host host_test292 exit_code = subprocess.call(shlex.split(293 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list host_test/nsca_cpu' % work_dir294 ))295 assert exit_code == 0296 def test_start_02_create_nrpe(self):297 # pylint: disable=no-self-use298 """ CLI to create backend objects - several services with the same name"""299 work_dir = os.path.abspath(os.path.dirname(__file__))300 work_dir = os.path.join(work_dir, 'json/nrpe')301 print("Creating backend elements...")302 # Create commands303 exit_code = subprocess.call(shlex.split(304 'python ../alignak_backend_client/backend_client.py -f "%s" -t command -d commands.json add' % work_dir305 ))306 assert exit_code == 0307 # Create templates308 exit_code = subprocess.call(shlex.split(309 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d hosts-templates.json add' % work_dir310 ))311 assert exit_code == 0312 exit_code = subprocess.call(shlex.split(313 'python ../alignak_backend_client/backend_client.py -f "%s" -t service -d services-templates.json add' % work_dir314 ))315 assert exit_code == 0316 def test_start_03_get_elements(self):317 # pylint: disable=no-self-use318 """ CLI to get default backend objects"""319 # work_dir = os.path.abspath(os.path.dirname(__file__))320 work_dir = '/tmp'321 files = ['alignak-object-list-realms.json',322 'alignak-object-list-commands.json',323 'alignak-object-list-timeperiods.json',324 'alignak-object-list-usergroups.json',325 'alignak-object-list-hostgroups.json',326 'alignak-object-list-servicegroups.json',327 'alignak-model-list-users.json',328 'alignak-model-list-hosts.json',329 'alignak-model-list-services.json',330 'alignak-object-list-users.json',331 'alignak-object-list-hosts.json',332 'alignak-object-list-services.json']333 for filename in files:334 if os.path.exists(os.path.join(work_dir, filename)):335 os.remove(os.path.join(work_dir, filename))336 print("Getting the backend default elements...")337 exit_code = subprocess.call(shlex.split(338 'python ../alignak_backend_client/backend_client.py -f "%s" -t realm list' % work_dir339 ))340 assert exit_code == 0341 exit_code = subprocess.call(shlex.split(342 'python ../alignak_backend_client/backend_client.py -f "%s" -t command list' % work_dir343 ))344 assert exit_code == 0345 exit_code = subprocess.call(shlex.split(346 'python ../alignak_backend_client/backend_client.py -f "%s" -t timeperiod list' % work_dir347 ))348 assert exit_code == 0349 exit_code = subprocess.call(shlex.split(350 'python ../alignak_backend_client/backend_client.py -f "%s" -t usergroup list' % work_dir351 ))352 assert exit_code == 0353 exit_code = subprocess.call(shlex.split(354 'python ../alignak_backend_client/backend_client.py -f "%s" -t hostgroup list' % work_dir355 ))356 assert exit_code == 0357 exit_code = subprocess.call(shlex.split(358 'python ../alignak_backend_client/backend_client.py -f "%s" -t servicegroup list' % work_dir359 ))360 assert exit_code == 0361 exit_code = subprocess.call(shlex.split(362 'python ../alignak_backend_client/backend_client.py -f "%s" -t user -m list' % work_dir363 ))364 assert exit_code == 0365 exit_code = subprocess.call(shlex.split(366 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -m list' % work_dir367 ))368 assert exit_code == 0369 exit_code = subprocess.call(shlex.split(370 'python ../alignak_backend_client/backend_client.py -f "%s" -t service -m list' % work_dir371 ))372 assert exit_code == 0373 exit_code = subprocess.call(shlex.split(374 'python ../alignak_backend_client/backend_client.py -f "%s" -t user list' % work_dir375 ))376 assert exit_code == 0377 exit_code = subprocess.call(shlex.split(378 'python ../alignak_backend_client/backend_client.py -f "%s" -t host list' % work_dir379 ))380 assert exit_code == 0381 exit_code = subprocess.call(shlex.split(382 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list' % work_dir383 ))384 assert exit_code == 0385 for filename in files:386 print("Exists %s?" % filename)387 assert os.path.exists(os.path.join(work_dir, filename))388 def test_start_04_update(self):389 # pylint: disable=no-self-use390 """ CLI to create backend objects"""391 work_dir = os.path.abspath(os.path.dirname(__file__))392 work_dir = os.path.join(work_dir, 'json')393 print("Updating backend elements...")394 # Unknown data file395 # First, dry-run ... it will not update!396 exit_code = subprocess.call(shlex.split(397 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d unknown.json -c update host_test' % work_dir398 ))399 assert exit_code == 2400 # Then we update401 exit_code = subprocess.call(shlex.split(402 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d unknown.json update host_test' % work_dir403 ))404 assert exit_code == 2405 # Update an host406 # First, dry-run ... it will not update!407 exit_code = subprocess.call(shlex.split(408 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d example_host_livestate.json -c update host_test' % work_dir409 ))410 assert exit_code == 0411 # Then we update412 exit_code = subprocess.call(shlex.split(413 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d example_host_livestate.json update host_test' % work_dir414 ))415 assert exit_code == 0416 # And again...417 exit_code = subprocess.call(shlex.split(418 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d example_host_livestate.json update host_test' % work_dir419 ))420 assert exit_code == 0421 # And again... re-using read data422 exit_code = subprocess.call(shlex.split(423 'python ../alignak_backend_client/backend_client.py -f "%s" -t host -d example_host_livestate.json update -i host_test' % work_dir424 ))425 assert exit_code == 0426 # Update a service427 # First, dry-run ... it will not update!428 exit_code = subprocess.call(shlex.split(429 'python ../alignak_backend_client/backend_client.py -f "%s" -t service -d example_service_livestate.json -c update host_test/nsca_cpu' % work_dir430 ))431 assert exit_code == 0432 exit_code = subprocess.call(shlex.split(433 'python ../alignak_backend_client/backend_client.py -f "%s" -t service -d example_service_livestate.json update host_test/nsca_cpu' % work_dir434 ))435 assert exit_code == 0436 exit_code = subprocess.call(shlex.split(437 'python ../alignak_backend_client/backend_client.py -f "%s" -t service -d example_service_livestate.json update -i host_test/nsca_cpu' % work_dir438 ))439 assert exit_code == 0440 # Get hosts and services lists441 exit_code = subprocess.call(shlex.split(442 'python ../alignak_backend_client/backend_client.py -f "%s" -c -t host list' % work_dir443 ))444 assert exit_code == 0445 exit_code = subprocess.call(shlex.split(446 'python ../alignak_backend_client/backend_client.py -f "%s" -t host list' % work_dir447 ))448 assert exit_code == 0449 exit_code = subprocess.call(shlex.split(450 'python ../alignak_backend_client/backend_client.py -f "%s" -c -t service list' % work_dir451 ))452 assert exit_code == 0453 exit_code = subprocess.call(shlex.split(454 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list' % work_dir455 ))456 assert exit_code == 0457 exit_code = subprocess.call(shlex.split(458 'python ../alignak_backend_client/backend_client.py -f "%s" -c -t service list host_test/*' % work_dir459 ))460 assert exit_code == 0461 exit_code = subprocess.call(shlex.split(462 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list host_test/*' % work_dir463 ))464 assert exit_code == 0465 def test_start_05_delete(self):466 # pylint: disable=no-self-use467 """ CLI to delete backend objects"""468 work_dir = os.path.abspath(os.path.dirname(__file__))469 work_dir = os.path.join(work_dir, 'json')470 print("Deleting backend elements...")471 # Delete all host services472 # First, dry-run ... it will not delete!473 exit_code = subprocess.call(shlex.split(474 'python ../alignak_backend_client/backend_client.py -t service delete -c host_test/*'475 ))476 assert exit_code == 0477 # Then we delete478 exit_code = subprocess.call(shlex.split(479 'python ../alignak_backend_client/backend_client.py -t service delete host_test/*'480 ))481 assert exit_code == 0482 # Delete host483 exit_code = subprocess.call(shlex.split(484 'python ../alignak_backend_client/backend_client.py -t host delete host_test'485 ))486 assert exit_code == 0487 # Delete a service of an host488 # First, dry-run ... it will not delete!489 exit_code = subprocess.call(shlex.split(490 'python ../alignak_backend_client/backend_client.py -t service delete -c host_test_2/nsca_services'491 ))492 assert exit_code == 0493 # Delete an unknown service of an host494 # First, dry-run ...495 exit_code = subprocess.call(shlex.split(496 'python ../alignak_backend_client/backend_client.py -t service delete -c host_test_2/unknown_service'497 ))498 assert exit_code == 2499 # Then real request500 exit_code = subprocess.call(shlex.split(501 'python ../alignak_backend_client/backend_client.py -t service delete host_test_2/unknown_service'502 ))503 assert exit_code == 2504 # Delete all users505 exit_code = subprocess.call(shlex.split(506 'python ../alignak_backend_client/backend_client.py -t user delete'507 ))508 assert exit_code == 0509 # Get hosts and services lists510 exit_code = subprocess.call(shlex.split(511 'python ../alignak_backend_client/backend_client.py -f "%s" -t host list' % work_dir512 ))513 assert exit_code == 0514 exit_code = subprocess.call(shlex.split(515 'python ../alignak_backend_client/backend_client.py -f "%s" -t service list' % work_dir516 ))...

Full Screen

Full Screen

test_cli.py

Source:test_cli.py Github

copy

Full Screen

1from __future__ import absolute_import2from __future__ import division3from __future__ import print_function4from __future__ import unicode_literals5from builtins import str6from builtins import super7import unittest8import mock9import click10from click.testing import CliRunner11from pprint import pprint12from beem import Steem, exceptions13from beem.account import Account14from beem.amount import Amount15from beemgraphenebase.account import PrivateKey16from beem.cli import cli, balance17from beem.instance import set_shared_steem_instance, shared_steem_instance18from beembase.operationids import getOperationNameForId19from beem.nodelist import NodeList20wif = "5Jt2wTfhUt5GkZHV1HYVfkEaJ6XnY8D2iA4qjtK9nnGXAhThM3w"21posting_key = "5Jh1Gtu2j4Yi16TfhoDmg8Qj3ULcgRi7A49JXdfUUTVPkaFaRKz"22memo_key = "5KPbCuocX26aMxN9CDPdUex4wCbfw9NoT5P7UhcqgDwxXa47bit"23pub_key = "STX52xMqKegLk4tdpNcUXU9Rw5DtdM9fxf3f12Gp55v1UjLX3ELZf"24class Testcases(unittest.TestCase):25 @classmethod26 def setUpClass(cls):27 nodelist = NodeList()28 nodelist.update_nodes()29 nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(exclude_limited=False), num_retries=10))30 cls.node_list = nodelist.get_nodes(exclude_limited=True)31 32 # stm = shared_steem_instance()33 # stm.config.refreshBackup()34 runner = CliRunner()35 result = runner.invoke(cli, ['-o', 'set', 'default_vote_weight', '100'])36 if result.exit_code != 0:37 raise AssertionError(str(result))38 result = runner.invoke(cli, ['-o', 'set', 'default_account', 'beem'])39 if result.exit_code != 0:40 raise AssertionError(str(result))41 result = runner.invoke(cli, ['-o', 'set', 'nodes', str(cls.node_list)])42 if result.exit_code != 0:43 raise AssertionError(str(result))44 result = runner.invoke(cli, ['createwallet', '--wipe'], input="test\ntest\n")45 if result.exit_code != 0:46 raise AssertionError(str(result))47 result = runner.invoke(cli, ['addkey'], input="test\n" + wif + "\n")48 if result.exit_code != 0:49 raise AssertionError(str(result))50 result = runner.invoke(cli, ['addkey'], input="test\n" + posting_key + "\n")51 if result.exit_code != 0:52 raise AssertionError(str(result))53 result = runner.invoke(cli, ['addkey'], input="test\n" + memo_key + "\n")54 if result.exit_code != 0:55 raise AssertionError(str(result))56 @classmethod57 def tearDownClass(cls):58 stm = shared_steem_instance()59 stm.config.recover_with_latest_backup()60 def test_balance(self):61 runner = CliRunner()62 result = runner.invoke(cli, ['balance', 'beembot', 'beempy'])63 self.assertEqual(result.exit_code, 0)64 def test_interest(self):65 runner = CliRunner()66 result = runner.invoke(cli, ['-ds', 'interest', 'beembot', 'beempy'])67 self.assertEqual(result.exit_code, 0)68 def test_config(self):69 runner = CliRunner()70 result = runner.invoke(cli, ['config'])71 self.assertEqual(result.exit_code, 0)72 def test_addkey(self):73 runner = CliRunner()74 result = runner.invoke(cli, ['createwallet', '--wipe'], input="test\ntest\n")75 self.assertEqual(result.exit_code, 0)76 result = runner.invoke(cli, ['addkey'], input="test\n" + wif + "\n")77 self.assertEqual(result.exit_code, 0)78 result = runner.invoke(cli, ['addkey'], input="test\n" + posting_key + "\n")79 self.assertEqual(result.exit_code, 0)80 def test_parsewif(self):81 runner = CliRunner()82 result = runner.invoke(cli, ['parsewif'], input=wif + "\nexit\n")83 self.assertEqual(result.exit_code, 0)84 result = runner.invoke(cli, ['parsewif', '--unsafe-import-key', wif])85 self.assertEqual(result.exit_code, 0)86 def test_delkey(self):87 runner = CliRunner()88 result = runner.invoke(cli, ['delkey', '--confirm', pub_key], input="test\n")89 self.assertEqual(result.exit_code, 0)90 result = runner.invoke(cli, ['addkey'], input="test\n" + posting_key + "\n")91 # self.assertEqual(result.exit_code, 0)92 def test_listkeys(self):93 runner = CliRunner()94 result = runner.invoke(cli, ['listkeys'])95 self.assertEqual(result.exit_code, 0)96 def test_listaccounts(self):97 runner = CliRunner()98 result = runner.invoke(cli, ['listaccounts'])99 self.assertEqual(result.exit_code, 0)100 def test_info(self):101 runner = CliRunner()102 result = runner.invoke(cli, ['info'])103 self.assertEqual(result.exit_code, 0)104 result = runner.invoke(cli, ['info', 'beembot'])105 self.assertEqual(result.exit_code, 0)106 result = runner.invoke(cli, ['info', '100'])107 self.assertEqual(result.exit_code, 0)108 result = runner.invoke(cli, ['info', '--', '-1'])109 self.assertEqual(result.exit_code, 0)110 result = runner.invoke(cli, ['info', pub_key])111 self.assertEqual(result.exit_code, 0)112 def test_info2(self):113 runner = CliRunner()114 result = runner.invoke(cli, ['info', '--', '-1:1'])115 self.assertEqual(result.exit_code, 0)116 result = runner.invoke(cli, ['info', 'gtg'])117 self.assertEqual(result.exit_code, 0)118 result = runner.invoke(cli, ['info', "@gtg/witness-gtg-log"])119 self.assertEqual(result.exit_code, 0)120 def test_changepassword(self):121 runner = CliRunner()122 result = runner.invoke(cli, ['changewalletpassphrase'], input="test\ntest\ntest\n")123 self.assertEqual(result.exit_code, 0)124 def test_walletinfo(self):125 runner = CliRunner()126 result = runner.invoke(cli, ['walletinfo'])127 self.assertEqual(result.exit_code, 0)128 def test_keygen(self):129 runner = CliRunner()130 result = runner.invoke(cli, ['keygen'])131 self.assertEqual(result.exit_code, 0)132 def test_set(self):133 runner = CliRunner()134 result = runner.invoke(cli, ['-o', 'set', 'set_default_vote_weight', '100'])135 self.assertEqual(result.exit_code, 0)136 def test_upvote(self):137 runner = CliRunner()138 result = runner.invoke(cli, ['-ds', 'upvote', '@steemit/firstpost'], input="test\n")139 self.assertEqual(result.exit_code, 0)140 result = runner.invoke(cli, ['-ds', 'upvote', '@steemit/firstpost', '100'], input="test\n")141 self.assertEqual(result.exit_code, 0)142 result = runner.invoke(cli, ['-ds', 'upvote', '--weight', '100', '@steemit/firstpost'], input="test\n")143 self.assertEqual(result.exit_code, 0)144 def test_downvote(self):145 runner = CliRunner()146 result = runner.invoke(cli, ['-ds', 'downvote', '@steemit/firstpost'], input="test\n")147 self.assertEqual(result.exit_code, 0)148 result = runner.invoke(cli, ['-ds', 'downvote', '@steemit/firstpost', '100'], input="test\n")149 self.assertEqual(result.exit_code, 0)150 result = runner.invoke(cli, ['-ds', 'downvote', '--weight', '100', '@steemit/firstpost'], input="test\n")151 self.assertEqual(result.exit_code, 0)152 def test_transfer(self):153 runner = CliRunner()154 result = runner.invoke(cli, ['-ds', 'transfer', 'beembot', '1', 'SBD', 'test'], input="test\n")155 self.assertEqual(result.exit_code, 0)156 def test_powerdownroute(self):157 runner = CliRunner()158 result = runner.invoke(cli, ['-ds', 'powerdownroute', 'beembot'], input="test\n")159 self.assertEqual(result.exit_code, 0)160 def test_convert(self):161 runner = CliRunner()162 result = runner.invoke(cli, ['-ds', 'convert', '1'], input="test\n")163 self.assertEqual(result.exit_code, 0)164 def test_powerup(self):165 runner = CliRunner()166 result = runner.invoke(cli, ['-ds', 'powerup', '1'], input="test\n")167 self.assertEqual(result.exit_code, 0)168 def test_powerdown(self):169 runner = CliRunner()170 result = runner.invoke(cli, ['-ds', 'powerdown', '1e3'], input="test\n")171 self.assertEqual(result.exit_code, 0)172 result = runner.invoke(cli, ['-ds', 'powerdown', '0'], input="test\n")173 self.assertEqual(result.exit_code, 0)174 def test_updatememokey(self):175 runner = CliRunner()176 result = runner.invoke(cli, ['-ds', 'updatememokey'], input="test\ntest\ntest\n")177 self.assertEqual(result.exit_code, 0)178 def test_permissions(self):179 runner = CliRunner()180 result = runner.invoke(cli, ['permissions', 'beembot'])181 self.assertEqual(result.exit_code, 0)182 def test_follower(self):183 runner = CliRunner()184 result = runner.invoke(cli, ['follower', 'beembot'])185 self.assertEqual(result.exit_code, 0)186 def test_following(self):187 runner = CliRunner()188 result = runner.invoke(cli, ['following', 'beembot'])189 self.assertEqual(result.exit_code, 0)190 def test_muter(self):191 runner = CliRunner()192 result = runner.invoke(cli, ['muter', 'beembot'])193 self.assertEqual(result.exit_code, 0)194 def test_muting(self):195 runner = CliRunner()196 result = runner.invoke(cli, ['muting', 'beem'])197 self.assertEqual(result.exit_code, 0)198 def test_allow_disallow(self):199 runner = CliRunner()200 result = runner.invoke(cli, ['-ds', 'allow', '--account', 'beembot', '--permission', 'posting', 'beempy'], input="test\n")201 self.assertEqual(result.exit_code, 0)202 result = runner.invoke(cli, ['-ds', 'disallow', '--account', 'holger80', '--permission', 'posting', 'rewarding'], input="test\n")203 self.assertEqual(result.exit_code, 0)204 def test_witnesses(self):205 runner = CliRunner()206 result = runner.invoke(cli, ['witnesses'])207 self.assertEqual(result.exit_code, 0)208 def test_votes(self):209 runner = CliRunner()210 result = runner.invoke(cli, ['votes', '--direction', 'out', 'test'])211 self.assertEqual(result.exit_code, 0)212 result = runner.invoke(cli, ['votes', '--direction', 'in', 'test'])213 self.assertEqual(result.exit_code, 0)214 def test_approvewitness(self):215 runner = CliRunner()216 result = runner.invoke(cli, ['-ds', 'approvewitness', '-a', 'beempy', 'holger80'], input="test\n")217 self.assertEqual(result.exit_code, 0)218 def test_disapprovewitness(self):219 runner = CliRunner()220 result = runner.invoke(cli, ['-ds', 'disapprovewitness', '-a', 'beempy', 'holger80'], input="test\n")221 self.assertEqual(result.exit_code, 0)222 def test_newaccount(self):223 runner = CliRunner()224 result = runner.invoke(cli, ['-ds', 'newaccount', 'beem3'], input="test\ntest\ntest\n")225 self.assertEqual(result.exit_code, 0)226 result = runner.invoke(cli, ['-ds', 'newaccount', 'beem3'], input="test\ntest\ntest\n")227 self.assertEqual(result.exit_code, 0)228 @unittest.skip229 def test_importaccount(self):230 runner = CliRunner()231 runner.invoke(cli, ['-o', 'set', 'nodes', str(self.node_list)])232 result = runner.invoke(cli, ['importaccount', '--roles', '["owner", "active", "posting", "memo"]', 'beem2'], input="test\numybjvCafrt8LdoCjEimQiQ4\n")233 self.assertEqual(result.exit_code, 0)234 result = runner.invoke(cli, ['delkey', '--confirm', 'STX7mLs2hns87f7kbf3o2HBqNoEaXiTeeU89eVF6iUCrMQJFzBsPo'], input="test\n")235 self.assertEqual(result.exit_code, 0)236 result = runner.invoke(cli, ['delkey', '--confirm', 'STX7rUmnpnCp9oZqMQeRKDB7GvXTM9KFvhzbA3AKcabgTBfQZgHZp'], input="test\n")237 self.assertEqual(result.exit_code, 0)238 result = runner.invoke(cli, ['delkey', '--confirm', 'STX6qGWHsCpmHbphnQbS2yfhvhJXDUVDwnsbnrMZkTqfnkNEZRoLP'], input="test\n")239 self.assertEqual(result.exit_code, 0)240 result = runner.invoke(cli, ['delkey', '--confirm', 'STX8Wvi74GYzBKgnUmiLvptzvxmPtXfjGPJL8QY3rebecXaxGGQyV'], input="test\n")241 self.assertEqual(result.exit_code, 0)242 def test_orderbook(self):243 runner = CliRunner()244 result = runner.invoke(cli, ['orderbook'])245 self.assertEqual(result.exit_code, 0)246 result = runner.invoke(cli, ['orderbook', '--show-date'])247 self.assertEqual(result.exit_code, 0)248 result = runner.invoke(cli, ['orderbook', '--chart'])249 self.assertEqual(result.exit_code, 0)250 def test_buy(self):251 runner = CliRunner()252 result = runner.invoke(cli, ['-ds', '-x', 'buy', '1', 'STEEM', '2.2'], input="test\n")253 self.assertEqual(result.exit_code, 0)254 result = runner.invoke(cli, ['-ds', '-x', 'buy', '1', 'STEEM'], input="y\ntest\n")255 self.assertEqual(result.exit_code, 0)256 result = runner.invoke(cli, ['-ds', '-x', 'buy', '1', 'SBD', '2.2'], input="test\n")257 self.assertEqual(result.exit_code, 0)258 result = runner.invoke(cli, ['-ds', '-x', 'buy', '1', 'SBD'], input="y\ntest\n")259 self.assertEqual(result.exit_code, 0)260 def test_sell(self):261 runner = CliRunner()262 result = runner.invoke(cli, ['-ds', '-x', 'sell', '1', 'STEEM', '2.2'], input="test\n")263 self.assertEqual(result.exit_code, 0)264 result = runner.invoke(cli, ['-ds', '-x', 'sell', '1', 'SBD', '2.2'], input="test\n")265 self.assertEqual(result.exit_code, 0)266 result = runner.invoke(cli, ['-ds', '-x', 'sell', '1', 'STEEM'], input="y\ntest\n")267 self.assertEqual(result.exit_code, 0)268 result = runner.invoke(cli, ['-ds', '-x', 'sell', '1', 'SBD'], input="y\ntest\n")269 self.assertEqual(result.exit_code, 0)270 def test_cancel(self):271 runner = CliRunner()272 result = runner.invoke(cli, ['-ds', 'cancel', '5'], input="test\n")273 self.assertEqual(result.exit_code, 0)274 def test_openorders(self):275 runner = CliRunner()276 result = runner.invoke(cli, ['openorders'])277 self.assertEqual(result.exit_code, 0)278 def test_resteem(self):279 runner = CliRunner()280 result = runner.invoke(cli, ['-dso', 'resteem', '@steemit/firstposte'], input="test\n")281 self.assertEqual(result.exit_code, 0)282 def test_follow_unfollow(self):283 runner = CliRunner()284 result = runner.invoke(cli, ['-dso', 'follow', 'beempy'], input="test\n")285 self.assertEqual(result.exit_code, 0)286 result = runner.invoke(cli, ['-dso', 'unfollow', 'beempy'], input="test\n")287 self.assertEqual(result.exit_code, 0)288 def test_mute_unmute(self):289 runner = CliRunner()290 result = runner.invoke(cli, ['-dso', 'mute', 'beempy'], input="test\n")291 self.assertEqual(result.exit_code, 0)292 result = runner.invoke(cli, ['-dso', 'unfollow', 'beempy'], input="test\n")293 self.assertEqual(result.exit_code, 0)294 def test_witnesscreate(self):295 runner = CliRunner()296 result = runner.invoke(cli, ['-ds', 'witnesscreate', 'beem', pub_key], input="test\n")297 def test_witnessupdate(self):298 runner = CliRunner()299 runner.invoke(cli, ['-ds', 'witnessupdate', 'gtg', '--maximum_block_size', 65000, '--account_creation_fee', 0.1, '--sbd_interest_rate', 0, '--url', 'https://google.de', '--signing_key', wif])300 def test_profile(self):301 runner = CliRunner()302 result = runner.invoke(cli, ['-ds', 'setprofile', 'url', 'https://google.de'], input="test\n")303 self.assertEqual(result.exit_code, 0)304 result = runner.invoke(cli, ['-ds', 'delprofile', 'url'], input="test\n")305 self.assertEqual(result.exit_code, 0)306 def test_claimreward(self):307 runner = CliRunner()308 result = runner.invoke(cli, ['-ds', 'claimreward'], input="test\n")309 result = runner.invoke(cli, ['-ds', 'claimreward', '--claim_all_steem'], input="test\n")310 result = runner.invoke(cli, ['-ds', 'claimreward', '--claim_all_sbd'], input="test\n")311 result = runner.invoke(cli, ['-ds', 'claimreward', '--claim_all_vests'], input="test\n")312 self.assertEqual(result.exit_code, 0)313 def test_power(self):314 runner = CliRunner()315 result = runner.invoke(cli, ['power'])316 self.assertEqual(result.exit_code, 0)317 def test_nextnode(self):318 runner = CliRunner()319 runner.invoke(cli, ['-o', 'set', 'nodes', self.node_list])320 result = runner.invoke(cli, ['-o', 'nextnode'])321 self.assertEqual(result.exit_code, 0)322 runner.invoke(cli, ['-o', 'set', 'nodes', str(self.node_list)])323 def test_pingnode(self):324 runner = CliRunner()325 result = runner.invoke(cli, ['pingnode'])326 self.assertEqual(result.exit_code, 0)327 result = runner.invoke(cli, ['pingnode', '--raw'])328 self.assertEqual(result.exit_code, 0)329 def test_updatenodes(self):330 runner = CliRunner()331 runner.invoke(cli, ['-o', 'set', 'nodes', self.node_list])332 result = runner.invoke(cli, ['updatenodes', '--test'])333 self.assertEqual(result.exit_code, 0)334 runner.invoke(cli, ['-o', 'set', 'nodes', str(self.node_list)])335 def test_currentnode(self):336 runner = CliRunner()337 runner.invoke(cli, ['-o', 'set', 'nodes', self.node_list])338 result = runner.invoke(cli, ['currentnode'])339 self.assertEqual(result.exit_code, 0)340 result = runner.invoke(cli, ['currentnode', '--url'])341 self.assertEqual(result.exit_code, 0)342 result = runner.invoke(cli, ['currentnode', '--version'])343 self.assertEqual(result.exit_code, 0)344 runner.invoke(cli, ['-o', 'set', 'nodes', str(self.node_list)])345 def test_ticker(self):346 runner = CliRunner()347 result = runner.invoke(cli, ['ticker'])348 self.assertEqual(result.exit_code, 0)349 def test_pricehistory(self):350 runner = CliRunner()351 result = runner.invoke(cli, ['pricehistory'])352 self.assertEqual(result.exit_code, 0)353 def test_pending(self):354 runner = CliRunner()355 result = runner.invoke(cli, ['pending', 'holger80'])356 self.assertEqual(result.exit_code, 0)357 result = runner.invoke(cli, ['pending', '--post', '--comment', '--curation', 'holger80'])358 self.assertEqual(result.exit_code, 0)359 result = runner.invoke(cli, ['pending', '--post', '--comment', '--curation', '--permlink', '--days', '1', 'holger80'])360 self.assertEqual(result.exit_code, 0)361 result = runner.invoke(cli, ['pending', '--post', '--comment', '--curation', '--author', '--days', '1', 'holger80'])362 self.assertEqual(result.exit_code, 0)363 result = runner.invoke(cli, ['pending', '--post', '--comment', '--curation', '--author', '--title', '--days', '1', 'holger80'])364 self.assertEqual(result.exit_code, 0)365 result = runner.invoke(cli, ['pending', '--post', '--comment', '--curation', '--author', '--permlink', '--length', '30', '--days', '1', 'holger80'])366 self.assertEqual(result.exit_code, 0)367 def test_rewards(self):368 runner = CliRunner()369 result = runner.invoke(cli, ['rewards', 'holger80'])370 self.assertEqual(result.exit_code, 0)371 result = runner.invoke(cli, ['rewards', '--post', '--comment', '--curation', 'holger80'])372 self.assertEqual(result.exit_code, 0)373 result = runner.invoke(cli, ['rewards', '--post', '--comment', '--curation', '--permlink', 'holger80'])374 self.assertEqual(result.exit_code, 0)375 result = runner.invoke(cli, ['rewards', '--post', '--comment', '--curation', '--author', 'holger80'])376 self.assertEqual(result.exit_code, 0)377 result = runner.invoke(cli, ['rewards', '--post', '--comment', '--curation', '--author', '--title', 'holger80'])378 self.assertEqual(result.exit_code, 0)379 result = runner.invoke(cli, ['rewards', '--post', '--comment', '--curation', '--author', '--permlink', '--length', '30', 'holger80'])380 self.assertEqual(result.exit_code, 0)381 def test_curation(self):382 runner = CliRunner()383 result = runner.invoke(cli, ['curation', "@gtg/witness-gtg-log"])384 self.assertEqual(result.exit_code, 0)385 def test_verify(self):386 runner = CliRunner()387 result = runner.invoke(cli, ['verify', '--trx', '3', '25304468'])388 self.assertEqual(result.exit_code, 0)389 result = runner.invoke(cli, ['verify', '--trx', '5', '25304468'])390 self.assertEqual(result.exit_code, 0)391 result = runner.invoke(cli, ['verify', '--trx', '0'])392 self.assertEqual(result.exit_code, 0)393 self.assertEqual(result.exit_code, 0)394 def test_tradehistory(self):395 runner = CliRunner()396 result = runner.invoke(cli, ['tradehistory'])...

Full Screen

Full Screen

test_iso9660.py

Source:test_iso9660.py Github

copy

Full Screen

1import os2import infra.basetest3BASIC_CONFIG = \4 """5 BR2_x86_pentium4=y6 BR2_TOOLCHAIN_EXTERNAL=y7 BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y8 BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y9 BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-i386-pentium4-full-2017.05-1078-g95b1dae.tar.bz2"10 BR2_TOOLCHAIN_EXTERNAL_GCC_6=y11 BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_2=y12 BR2_TOOLCHAIN_EXTERNAL_LOCALE=y13 # BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set14 BR2_TOOLCHAIN_EXTERNAL_CXX=y15 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"16 BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y17 BR2_LINUX_KERNEL=y18 BR2_LINUX_KERNEL_CUSTOM_VERSION=y19 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11"20 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y21 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="{}"22 # BR2_TARGET_ROOTFS_TAR is not set23 """.format(infra.filepath("conf/minimal-x86-qemu-kernel.config"))24def test_mount_internal_external(emulator, builddir, internal=True):25 img = os.path.join(builddir, "images", "rootfs.iso9660")26 emulator.boot(arch="i386", options=["-cdrom", img])27 emulator.login()28 if internal:29 cmd = "mount | grep 'rootfs on / type rootfs'"30 else:31 cmd = "mount | grep '/dev/root on / type iso9660'"32 _, exit_code = emulator.run(cmd)33 return exit_code34def test_touch_file(emulator):35 _, exit_code = emulator.run("touch test")36 return exit_code37#38# Grub 239class TestIso9660Grub2External(infra.basetest.BRTest):40 config = BASIC_CONFIG + \41 """42 BR2_TARGET_ROOTFS_ISO9660=y43 # BR2_TARGET_ROOTFS_ISO9660_INITRD is not set44 BR2_TARGET_GRUB2=y45 BR2_TARGET_GRUB2_BOOT_PARTITION="cd"46 BR2_TARGET_GRUB2_BUILTIN_MODULES="boot linux ext2 fat part_msdos part_gpt normal biosdisk iso9660"47 BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"48 """.format(infra.filepath("conf/grub2.cfg"))49 def test_run(self):50 exit_code = test_mount_internal_external(self.emulator,51 self.builddir, internal=False)52 self.assertEqual(exit_code, 0)53 exit_code = test_touch_file(self.emulator)54 self.assertEqual(exit_code, 1)55class TestIso9660Grub2ExternalCompress(infra.basetest.BRTest):56 config = BASIC_CONFIG + \57 """58 BR2_TARGET_ROOTFS_ISO9660=y59 # BR2_TARGET_ROOTFS_ISO9660_INITRD is not set60 BR2_TARGET_ROOTFS_ISO9660_TRANSPARENT_COMPRESSION=y61 BR2_TARGET_GRUB2=y62 BR2_TARGET_GRUB2_BOOT_PARTITION="cd"63 BR2_TARGET_GRUB2_BUILTIN_MODULES="boot linux ext2 fat part_msdos part_gpt normal biosdisk iso9660"64 BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"65 """.format(infra.filepath("conf/grub2.cfg"))66 def test_run(self):67 exit_code = test_mount_internal_external(self.emulator,68 self.builddir, internal=False)69 self.assertEqual(exit_code, 0)70 exit_code = test_touch_file(self.emulator)71 self.assertEqual(exit_code, 1)72class TestIso9660Grub2Internal(infra.basetest.BRTest):73 config = BASIC_CONFIG + \74 """75 BR2_TARGET_ROOTFS_ISO9660=y76 BR2_TARGET_ROOTFS_ISO9660_INITRD=y77 BR2_TARGET_GRUB2=y78 BR2_TARGET_GRUB2_BOOT_PARTITION="cd"79 BR2_TARGET_GRUB2_BUILTIN_MODULES="boot linux ext2 fat part_msdos part_gpt normal biosdisk iso9660"80 BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"81 """.format(infra.filepath("conf/grub2.cfg"))82 def test_run(self):83 exit_code = test_mount_internal_external(self.emulator,84 self.builddir, internal=True)85 self.assertEqual(exit_code, 0)86 exit_code = test_touch_file(self.emulator)87 self.assertEqual(exit_code, 0)88#89# Syslinux90class TestIso9660SyslinuxExternal(infra.basetest.BRTest):91 config = BASIC_CONFIG + \92 """93 BR2_TARGET_ROOTFS_ISO9660=y94 # BR2_TARGET_ROOTFS_ISO9660_INITRD is not set95 BR2_TARGET_ROOTFS_ISO9660_HYBRID=y96 BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"97 BR2_TARGET_SYSLINUX=y98 """.format(infra.filepath("conf/isolinux.cfg"))99 def test_run(self):100 exit_code = test_mount_internal_external(self.emulator,101 self.builddir, internal=False)102 self.assertEqual(exit_code, 0)103 exit_code = test_touch_file(self.emulator)104 self.assertEqual(exit_code, 1)105class TestIso9660SyslinuxExternalCompress(infra.basetest.BRTest):106 config = BASIC_CONFIG + \107 """108 BR2_TARGET_ROOTFS_ISO9660=y109 # BR2_TARGET_ROOTFS_ISO9660_INITRD is not set110 BR2_TARGET_ROOTFS_ISO9660_TRANSPARENT_COMPRESSION=y111 BR2_TARGET_ROOTFS_ISO9660_HYBRID=y112 BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"113 BR2_TARGET_SYSLINUX=y114 """.format(infra.filepath("conf/isolinux.cfg"))115 def test_run(self):116 exit_code = test_mount_internal_external(self.emulator,117 self.builddir, internal=False)118 self.assertEqual(exit_code, 0)119 exit_code = test_touch_file(self.emulator)120 self.assertEqual(exit_code, 1)121class TestIso9660SyslinuxInternal(infra.basetest.BRTest):122 config = BASIC_CONFIG + \123 """124 BR2_TARGET_ROOTFS_ISO9660=y125 BR2_TARGET_ROOTFS_ISO9660_INITRD=y126 BR2_TARGET_ROOTFS_ISO9660_HYBRID=y127 BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"128 BR2_TARGET_SYSLINUX=y129 """.format(infra.filepath("conf/isolinux.cfg"))130 def test_run(self):131 exit_code = test_mount_internal_external(self.emulator,132 self.builddir, internal=True)133 self.assertEqual(exit_code, 0)134 exit_code = test_touch_file(self.emulator)...

Full Screen

Full Screen

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 autotest 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