diff options
| author | David Reyna <David.Reyna@windriver.com> | 2017-04-05 15:18:20 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-10 23:00:32 +0100 |
| commit | 123ec6ebc252f46a2efdd69bd65ded533712bd99 (patch) | |
| tree | d8405374c6892cb414e51b288a3d311b9c36ffec /bitbake/lib/toaster/tests/builds | |
| parent | f45a5a5de8ee8e7b014a780aa45b37774a4b06a1 (diff) | |
| download | poky-123ec6ebc252f46a2efdd69bd65ded533712bd99.tar.gz | |
bitbake: toaster:test:Create selenium tests for project dashboard page
Added 7 new testcases that verify the UI interface and elements of the project detail page.
This testcases can be found on testopia in the links:
Verifies that the project is created and that you get redirected to the configuration page
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1514
Verifies that the left side bar menu, all links are clickable and they show on the UI
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1515
Verifies that after creating a project the default project configuration is created
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1516
Verifies that the default machine is set, once creating the project
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1517
Verifies the built recipes information of the project detail page
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1518
Verifies the default release information of the project
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1519
Verifies that the default layers are assigned to the project
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1520
Verifies that the links to the Configuration, Builds, Import layer and New Custom Image are present and work.
[YOCTO #9808]
(Bitbake rev: eaeddaf96efb8079b307652eac208f4ab5019ad4)
Signed-off-by: Libertad Cruz <libertad.cruz@intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/builds')
| -rw-r--r-- | bitbake/lib/toaster/tests/builds/buildtest.py | 110 |
1 files changed, 56 insertions, 54 deletions
diff --git a/bitbake/lib/toaster/tests/builds/buildtest.py b/bitbake/lib/toaster/tests/builds/buildtest.py index bf147f09e5..5a56a110a7 100644 --- a/bitbake/lib/toaster/tests/builds/buildtest.py +++ b/bitbake/lib/toaster/tests/builds/buildtest.py | |||
| @@ -41,6 +41,61 @@ logger = logging.getLogger("toaster") | |||
| 41 | # want to wrap everything in a database transaction as an external process | 41 | # want to wrap everything in a database transaction as an external process |
| 42 | # (bitbake needs access to the database) | 42 | # (bitbake needs access to the database) |
| 43 | 43 | ||
| 44 | def load_build_environment(): | ||
| 45 | call_command('loaddata', 'settings.xml', app_label="orm") | ||
| 46 | call_command('loaddata', 'poky.xml', app_label="orm") | ||
| 47 | |||
| 48 | current_builddir = os.environ.get("BUILDDIR") | ||
| 49 | if current_builddir: | ||
| 50 | BuildTest.BUILDDIR = current_builddir | ||
| 51 | else: | ||
| 52 | # Setup a builddir based on default layout | ||
| 53 | # bitbake inside openebedded-core | ||
| 54 | oe_init_build_env_path = os.path.join( | ||
| 55 | os.path.dirname(os.path.abspath(__file__)), | ||
| 56 | os.pardir, | ||
| 57 | os.pardir, | ||
| 58 | os.pardir, | ||
| 59 | os.pardir, | ||
| 60 | os.pardir, | ||
| 61 | 'oe-init-build-env' | ||
| 62 | ) | ||
| 63 | if not os.path.exists(oe_init_build_env_path): | ||
| 64 | raise Exception("We had no BUILDDIR set and couldn't " | ||
| 65 | "find oe-init-build-env to set this up " | ||
| 66 | "ourselves please run oe-init-build-env " | ||
| 67 | "before running these tests") | ||
| 68 | |||
| 69 | oe_init_build_env_path = os.path.realpath(oe_init_build_env_path) | ||
| 70 | cmd = "bash -c 'source oe-init-build-env %s'" % BuildTest.BUILDDIR | ||
| 71 | p = subprocess.Popen( | ||
| 72 | cmd, | ||
| 73 | cwd=os.path.dirname(oe_init_build_env_path), | ||
| 74 | shell=True, | ||
| 75 | stdout=subprocess.PIPE, | ||
| 76 | stderr=subprocess.PIPE) | ||
| 77 | |||
| 78 | output, err = p.communicate() | ||
| 79 | p.wait() | ||
| 80 | |||
| 81 | logger.info("oe-init-build-env %s %s" % (output, err)) | ||
| 82 | |||
| 83 | os.environ['BUILDDIR'] = BuildTest.BUILDDIR | ||
| 84 | |||
| 85 | # Setup the path to bitbake we know where to find this | ||
| 86 | bitbake_path = os.path.join( | ||
| 87 | os.path.dirname(os.path.abspath(__file__)), | ||
| 88 | os.pardir, | ||
| 89 | os.pardir, | ||
| 90 | os.pardir, | ||
| 91 | os.pardir, | ||
| 92 | 'bin', | ||
| 93 | 'bitbake') | ||
| 94 | if not os.path.exists(bitbake_path): | ||
| 95 | raise Exception("Could not find bitbake at the expected path %s" | ||
| 96 | % bitbake_path) | ||
| 97 | |||
| 98 | os.environ['BBBASEDIR'] = bitbake_path | ||
| 44 | 99 | ||
| 45 | class BuildTest(unittest.TestCase): | 100 | class BuildTest(unittest.TestCase): |
| 46 | 101 | ||
| @@ -59,60 +114,7 @@ class BuildTest(unittest.TestCase): | |||
| 59 | if built: | 114 | if built: |
| 60 | return built | 115 | return built |
| 61 | 116 | ||
| 62 | call_command('loaddata', 'settings.xml', app_label="orm") | 117 | load_build_environment() |
| 63 | call_command('loaddata', 'poky.xml', app_label="orm") | ||
| 64 | |||
| 65 | current_builddir = os.environ.get("BUILDDIR") | ||
| 66 | if current_builddir: | ||
| 67 | BuildTest.BUILDDIR = current_builddir | ||
| 68 | else: | ||
| 69 | # Setup a builddir based on default layout | ||
| 70 | # bitbake inside openebedded-core | ||
| 71 | oe_init_build_env_path = os.path.join( | ||
| 72 | os.path.dirname(os.path.abspath(__file__)), | ||
| 73 | os.pardir, | ||
| 74 | os.pardir, | ||
| 75 | os.pardir, | ||
| 76 | os.pardir, | ||
| 77 | os.pardir, | ||
| 78 | 'oe-init-build-env' | ||
| 79 | ) | ||
| 80 | if not os.path.exists(oe_init_build_env_path): | ||
| 81 | raise Exception("We had no BUILDDIR set and couldn't " | ||
| 82 | "find oe-init-build-env to set this up " | ||
| 83 | "ourselves please run oe-init-build-env " | ||
| 84 | "before running these tests") | ||
| 85 | |||
| 86 | oe_init_build_env_path = os.path.realpath(oe_init_build_env_path) | ||
| 87 | cmd = "bash -c 'source oe-init-build-env %s'" % BuildTest.BUILDDIR | ||
| 88 | p = subprocess.Popen( | ||
| 89 | cmd, | ||
| 90 | cwd=os.path.dirname(oe_init_build_env_path), | ||
| 91 | shell=True, | ||
| 92 | stdout=subprocess.PIPE, | ||
| 93 | stderr=subprocess.PIPE) | ||
| 94 | |||
| 95 | output, err = p.communicate() | ||
| 96 | p.wait() | ||
| 97 | |||
| 98 | logger.info("oe-init-build-env %s %s" % (output, err)) | ||
| 99 | |||
| 100 | os.environ['BUILDDIR'] = BuildTest.BUILDDIR | ||
| 101 | |||
| 102 | # Setup the path to bitbake we know where to find this | ||
| 103 | bitbake_path = os.path.join( | ||
| 104 | os.path.dirname(os.path.abspath(__file__)), | ||
| 105 | os.pardir, | ||
| 106 | os.pardir, | ||
| 107 | os.pardir, | ||
| 108 | os.pardir, | ||
| 109 | 'bin', | ||
| 110 | 'bitbake') | ||
| 111 | if not os.path.exists(bitbake_path): | ||
| 112 | raise Exception("Could not find bitbake at the expected path %s" | ||
| 113 | % bitbake_path) | ||
| 114 | |||
| 115 | os.environ['BBBASEDIR'] = bitbake_path | ||
| 116 | 118 | ||
| 117 | BuildEnvironment.objects.get_or_create( | 119 | BuildEnvironment.objects.get_or_create( |
| 118 | betype=BuildEnvironment.TYPE_LOCAL, | 120 | betype=BuildEnvironment.TYPE_LOCAL, |
