mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
oe-selftest: pylinted wic tests
Fixed the following pylint warnings:
C: 45, 0: Line too long (91/80) (line-too-long)
C:105, 0: Wrong continued indentation.
ignore_status=True).status)
^ | (bad-continuation)
W: 83, 8: Redefining built-in 'vars' (redefined-builtin)
W:175, 8: Redefining built-in 'vars' (redefined-builtin)
W: 27, 0: Unused import sys (unused-import)
(From OE-Core rev: ecb5320e766d0fa031c269d6d9b2a24c81c7aa7e)
(From OE-Core rev: c47af4a772883c86559673ba9b9f774f0ff0d54c)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
9b6dc9b07e
commit
80e8928942
@@ -24,7 +24,6 @@
|
|||||||
"""Test cases for wic."""
|
"""Test cases for wic."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
|
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
@@ -42,7 +41,8 @@ class Wic(oeSelfTest):
|
|||||||
|
|
||||||
def setUpLocal(self):
|
def setUpLocal(self):
|
||||||
"""This code is executed before each test method."""
|
"""This code is executed before each test method."""
|
||||||
self.write_config('IMAGE_FSTYPES += " hddimg"\nMACHINE_FEATURES_append = " efi"\n')
|
self.write_config('IMAGE_FSTYPES += " hddimg"\n'
|
||||||
|
'MACHINE_FEATURES_append = " efi"\n')
|
||||||
|
|
||||||
# Do this here instead of in setUpClass as the base setUp does some
|
# Do this here instead of in setUpClass as the base setUp does some
|
||||||
# clean up which can result in the native tools built earlier in
|
# clean up which can result in the native tools built earlier in
|
||||||
@@ -80,14 +80,14 @@ class Wic(oeSelfTest):
|
|||||||
@testcase(1212)
|
@testcase(1212)
|
||||||
def test_build_artifacts(self):
|
def test_build_artifacts(self):
|
||||||
"""Test wic create directdisk providing all artifacts."""
|
"""Test wic create directdisk providing all artifacts."""
|
||||||
vars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
|
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
|
||||||
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
|
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
|
||||||
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
|
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
|
||||||
status = runCmd("wic create directdisk "
|
status = runCmd("wic create directdisk "
|
||||||
"-b %(staging_datadir)s "
|
"-b %(staging_datadir)s "
|
||||||
"-k %(deploy_dir_image)s "
|
"-k %(deploy_dir_image)s "
|
||||||
"-n %(staging_dir_native)s "
|
"-n %(staging_dir_native)s "
|
||||||
"-r %(image_rootfs)s" % vars).status
|
"-r %(image_rootfs)s" % bbvars).status
|
||||||
self.assertEqual(0, status)
|
self.assertEqual(0, status)
|
||||||
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
|
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class Wic(oeSelfTest):
|
|||||||
def test_unsupported_subcommand(self):
|
def test_unsupported_subcommand(self):
|
||||||
"""Test unsupported subcommand"""
|
"""Test unsupported subcommand"""
|
||||||
self.assertEqual(1, runCmd('wic unsupported',
|
self.assertEqual(1, runCmd('wic unsupported',
|
||||||
ignore_status=True).status)
|
ignore_status=True).status)
|
||||||
|
|
||||||
@testcase(1214)
|
@testcase(1214)
|
||||||
def test_no_command(self):
|
def test_no_command(self):
|
||||||
@@ -172,20 +172,20 @@ class Wic(oeSelfTest):
|
|||||||
@testcase(1269)
|
@testcase(1269)
|
||||||
def test_rootfs_artifacts(self):
|
def test_rootfs_artifacts(self):
|
||||||
"""Test usage of rootfs plugin with rootfs paths"""
|
"""Test usage of rootfs plugin with rootfs paths"""
|
||||||
vars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
|
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
|
||||||
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
|
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
|
||||||
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
|
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
|
||||||
vars['wks'] = "directdisk-multi-rootfs"
|
bbvars['wks'] = "directdisk-multi-rootfs"
|
||||||
status = runCmd("wic create %(wks)s "
|
status = runCmd("wic create %(wks)s "
|
||||||
"-b %(staging_datadir)s "
|
"-b %(staging_datadir)s "
|
||||||
"-k %(deploy_dir_image)s "
|
"-k %(deploy_dir_image)s "
|
||||||
"-n %(staging_dir_native)s "
|
"-n %(staging_dir_native)s "
|
||||||
"--rootfs-dir rootfs1=%(image_rootfs)s "
|
"--rootfs-dir rootfs1=%(image_rootfs)s "
|
||||||
"--rootfs-dir rootfs2=%(image_rootfs)s" \
|
"--rootfs-dir rootfs2=%(image_rootfs)s" \
|
||||||
% vars).status
|
% bbvars).status
|
||||||
self.assertEqual(0, status)
|
self.assertEqual(0, status)
|
||||||
self.assertEqual(1, len(glob(self.resultdir + \
|
self.assertEqual(1, len(glob(self.resultdir + \
|
||||||
"%(wks)s-*.direct" % vars)))
|
"%(wks)s-*.direct" % bbvars)))
|
||||||
|
|
||||||
@testcase(1346)
|
@testcase(1346)
|
||||||
def test_iso_image(self):
|
def test_iso_image(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user