|
|
@@ -1,7 +1,7 @@
|
|
|
import os
|
|
|
import shutil
|
|
|
|
|
|
-from tests.download.gitremote import GitRemote
|
|
|
+import tests.download.gitconfig
|
|
|
|
|
|
import infra
|
|
|
|
|
|
@@ -12,29 +12,35 @@ class GitTestBase(infra.basetest.BRConfigTest):
|
|
|
BR2_BACKUP_SITE=""
|
|
|
"""
|
|
|
gitremotedir = infra.filepath("tests/download/git-remote")
|
|
|
- gitremote = None
|
|
|
|
|
|
def setUp(self):
|
|
|
super(GitTestBase, self).setUp()
|
|
|
- self.gitremote = GitRemote(self.builddir, self.gitremotedir, self.logtofile)
|
|
|
+
|
|
|
+ self.show_msg("Generating custom git config")
|
|
|
+ tests.download.gitconfig.generate_gitconfig(self.builddir,
|
|
|
+ self.logtofile,
|
|
|
+ self.gitremotedir)
|
|
|
|
|
|
def tearDown(self):
|
|
|
self.show_msg("Cleaning up")
|
|
|
- if self.gitremote:
|
|
|
- self.gitremote.stop()
|
|
|
if self.b and not self.keepbuilds:
|
|
|
self.b.delete()
|
|
|
|
|
|
def check_hash(self, package):
|
|
|
+ gitconfig = os.path.join(self.builddir,
|
|
|
+ tests.download.gitconfig.GIT_CONFIG_FILE)
|
|
|
# store downloaded tarball inside the output dir so the test infra
|
|
|
# cleans it up at the end
|
|
|
env = {"BR2_DL_DIR": os.path.join(self.builddir, "dl"),
|
|
|
- "GITREMOTE_PORT_NUMBER": str(self.gitremote.port)}
|
|
|
+ "GITREMOTE_DIR": self.gitremotedir,
|
|
|
+ "GIT_CONFIG_GLOBAL": gitconfig}
|
|
|
self.b.build(["{}-dirclean".format(package),
|
|
|
"{}-source".format(package)],
|
|
|
env)
|
|
|
|
|
|
def check_download(self, package):
|
|
|
+ gitconfig = os.path.join(self.builddir,
|
|
|
+ tests.download.gitconfig.GIT_CONFIG_FILE)
|
|
|
# store downloaded tarball inside the output dir so the test infra
|
|
|
# cleans it up at the end
|
|
|
dl_dir = os.path.join(self.builddir, "dl")
|
|
|
@@ -42,7 +48,8 @@ class GitTestBase(infra.basetest.BRConfigTest):
|
|
|
if os.path.exists(dl_dir):
|
|
|
shutil.rmtree(dl_dir)
|
|
|
env = {"BR2_DL_DIR": dl_dir,
|
|
|
- "GITREMOTE_PORT_NUMBER": str(self.gitremote.port)}
|
|
|
+ "GITREMOTE_DIR": self.gitremotedir,
|
|
|
+ "GIT_CONFIG_GLOBAL": gitconfig}
|
|
|
self.b.build(["{}-dirclean".format(package),
|
|
|
"{}-legal-info".format(package)],
|
|
|
env)
|