示例#1
0
文件: processspec.py 项目: pid0/sibt
 def _buildSibtCall(self):
     return [
         relativeToProjectRoot("sibt/sibt"), "--config-dir",
         self.paths.configDir, "--var-dir", self.paths.varDir,
         "--readonly-dir", self.paths.readonlyDir, "--no-sys-config",
         "--utc"
     ]
示例#2
0
文件: processspec.py 项目: pid0/sibt
 def useActualSibtConfig(self):
     for dest in [
             self.paths.readonlySchedulersDir,
             self.paths.readonlySynchronizersDir, self.paths.runnersDir
     ]:
         shutil.copytree(
             relativeToProjectRoot("sibt/" + os.path.basename(dest)), dest)
示例#3
0
文件: rsync_test.py 项目: pid0/sibt
 def test_shouldCorrectlyReanchorExcludedDirs(self, funcFixture):
     assert funcFixture.compute("""
   source '{0}' /dev/null ''
   declare -a ExcludedDirs=(/mnt/data)
   declare -a result=()
   -get-reanchored-exclude-opts mnt 1 result
   echo -n "${result[1]}" """.replace(
         "{0}",
         relativeToProjectRoot("sibt/runners/bash-runner"))) == b"/data/"
示例#4
0
def loadModule(schedulerName,
               varDir,
               sibtCall=["/where/sibt/is"],
               logger=None,
               clock=None):
    global testPackageCounter
    testPackageCounter = testPackageCounter + 1
    packageName = "testpackage{0}".format(testPackageCounter)
    loader = PyModuleSchedulerLoader(PyModuleLoader(packageName))
    modulePath = relativeToProjectRoot(
        os.path.join("sibt", "schedulers", schedulerName))
    return configrepo.loadSchedulerFromModule(
        loader, modulePath, schedulerName,
        configrepo.SchedulerArgs(sibtCall, str(varDir), logger, clock))
示例#5
0
    def load(self, synchronizerName):
        path = relativeToProjectRoot("sibt/synchronizers/" + synchronizerName)
        self.syncer = loadSynchronizer(path)

        self.loc1 = self.tmpdir.mkdir("Loc $1\"\\'")
        self.loc2 = self.tmpdir.mkdir("Loc $2\"\\'")
示例#6
0
def bashFuncFixture():
    return BashFuncTestFixture(
        relativeToProjectRoot("sibt/runners/bash-runner"), "/dev/null ''")
示例#7
0
文件: rsync_test.py 项目: pid0/sibt
def funcFixture():
    return BashFuncTestFixture(
        relativeToProjectRoot("sibt/synchronizers/rsync"))
示例#8
0
文件: tar_test.py 项目: pid0/sibt
 def __init__(self, tmpdir):
     super().__init__(relativeToProjectRoot("sibt/synchronizers/tar"))
     self.snapshotFile = tmpdir / "snapshot"
示例#9
0
 def __init__(self, tmpdir):
     super().__init__(relativeToProjectRoot("sibt/synchronizers/duplicity"))
示例#10
0
文件: __init__.py 项目: pid0/sibt
def loadSynchronizer(absolutePath):
    processRunner = configrepo.createHashbangAwareProcessRunner(
        relativeToProjectRoot("sibt/runners"), CoprocessRunner())
    return configrepo.loadSynchronizer(processRunner, absolutePath,
                                       os.path.basename(absolutePath))