diff options
Diffstat (limited to 'bitbake/lib/bb/tests/setup.py')
| -rw-r--r-- | bitbake/lib/bb/tests/setup.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py index fb2c15f545..329a0c5259 100644 --- a/bitbake/lib/bb/tests/setup.py +++ b/bitbake/lib/bb/tests/setup.py | |||
| @@ -87,7 +87,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
| 87 | bbsetup = os.path.abspath(os.path.dirname(__file__) + "/../../../bin/bitbake-setup") | 87 | bbsetup = os.path.abspath(os.path.dirname(__file__) + "/../../../bin/bitbake-setup") |
| 88 | return bb.process.run("{} --global-settings {} {}".format(bbsetup, os.path.join(self.tempdir, 'global-config'), cmd)) | 88 | return bb.process.run("{} --global-settings {} {}".format(bbsetup, os.path.join(self.tempdir, 'global-config'), cmd)) |
| 89 | 89 | ||
| 90 | def add_json_config_to_registry(self, name, rev): | 90 | def add_json_config_to_registry(self, name, rev, branch): |
| 91 | config = """ | 91 | config = """ |
| 92 | { | 92 | { |
| 93 | "sources": { | 93 | "sources": { |
| @@ -98,6 +98,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
| 98 | "uri": "file://%s" | 98 | "uri": "file://%s" |
| 99 | } | 99 | } |
| 100 | }, | 100 | }, |
| 101 | "branch": "%s", | ||
| 101 | "rev": "%s" | 102 | "rev": "%s" |
| 102 | }, | 103 | }, |
| 103 | "path": "test-repo" | 104 | "path": "test-repo" |
| @@ -134,7 +135,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
| 134 | }, | 135 | }, |
| 135 | "version": "1.0" | 136 | "version": "1.0" |
| 136 | } | 137 | } |
| 137 | """ % (self.testrepopath, rev) | 138 | """ % (self.testrepopath, branch, rev) |
| 138 | os.makedirs(os.path.join(self.registrypath, os.path.dirname(name)), exist_ok=True) | 139 | os.makedirs(os.path.join(self.registrypath, os.path.dirname(name)), exist_ok=True) |
| 139 | with open(os.path.join(self.registrypath, name), 'w') as f: | 140 | with open(os.path.join(self.registrypath, name), 'w') as f: |
| 140 | f.write(config) | 141 | f.write(config) |
| @@ -208,12 +209,12 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
| 208 | self.assertNotIn("test-config-1", out[0]) | 209 | self.assertNotIn("test-config-1", out[0]) |
| 209 | self.assertNotIn("test-config-2", out[0]) | 210 | self.assertNotIn("test-config-2", out[0]) |
| 210 | 211 | ||
| 211 | json_1 = self.add_json_config_to_registry('test-config-1.conf.json', 'master') | 212 | json_1 = self.add_json_config_to_registry('test-config-1.conf.json', 'master', 'master') |
| 212 | out = self.runbbsetup("list") | 213 | out = self.runbbsetup("list") |
| 213 | self.assertIn("test-config-1", out[0]) | 214 | self.assertIn("test-config-1", out[0]) |
| 214 | self.assertNotIn("test-config-2", out[0]) | 215 | self.assertNotIn("test-config-2", out[0]) |
| 215 | 216 | ||
| 216 | json_2 = self.add_json_config_to_registry('config-2/test-config-2.conf.json', 'master') | 217 | json_2 = self.add_json_config_to_registry('config-2/test-config-2.conf.json', 'master', 'master') |
| 217 | out = self.runbbsetup("list --write-json={}".format(os.path.join(self.tempdir, "test-configs.json"))) | 218 | out = self.runbbsetup("list --write-json={}".format(os.path.join(self.tempdir, "test-configs.json"))) |
| 218 | self.assertIn("test-config-1", out[0]) | 219 | self.assertIn("test-config-1", out[0]) |
| 219 | self.assertIn("test-config-2", out[0]) | 220 | self.assertIn("test-config-2", out[0]) |
| @@ -270,7 +271,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
| 270 | branch = "another-branch" | 271 | branch = "another-branch" |
| 271 | self.git('checkout -b {}'.format(branch), cwd=self.testrepopath) | 272 | self.git('checkout -b {}'.format(branch), cwd=self.testrepopath) |
| 272 | self.add_file_to_testrepo('test-file', test_file_content) | 273 | self.add_file_to_testrepo('test-file', test_file_content) |
| 273 | json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch) | 274 | json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch) |
| 274 | for c in ('gadget','gizmo','gadget-notemplate','gizmo-notemplate'): | 275 | for c in ('gadget','gizmo','gadget-notemplate','gizmo-notemplate'): |
| 275 | buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) | 276 | buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) |
| 276 | os.environ['BBPATH'] = os.path.join(buildpath, 'build') | 277 | os.environ['BBPATH'] = os.path.join(buildpath, 'build') |
