Example #1
0
def _RunUpgrade(path,
                dry_run,
                no_verify,
                ignore_hostname=True,
                downgrade=False):
    cmd = [
        sys.executable,
        "%s/tools/cfgupgrade" % testutils.GetSourceDir(), "--debug", "--force",
        "--path=%s" % path,
        "--confdir=%s" % path
    ]

    if ignore_hostname:
        cmd.append("--ignore-hostname")
    if dry_run:
        cmd.append("--dry-run")
    if no_verify:
        cmd.append("--no-verify")
    if downgrade:
        cmd.append("--downgrade")

    result = utils.RunCmd(cmd, cwd=os.getcwd())
    if result.failed:
        raise Exception("cfgupgrade failed: %s, output %r" %
                        (result.fail_reason, result.output))
Example #2
0
def _ReadDocFile(filename):
    return utils.ReadFile("%s/doc/%s" % (testutils.GetSourceDir(), filename))
Example #3
0
 def _ReadManFile(name):
     return utils.ReadFile("%s/man/%s.rst" %
                           (testutils.GetSourceDir(), name))
    def setUp(self):
        filename = "%s/qa/qa-sample.json" % testutils.GetSourceDir()

        self.config = qa_config._QaConfig.Load(filename)
Example #5
0
def _GetFullFilename(file_name):
  file_path = "%s/test/data/ovfdata/%s" % (testutils.GetSourceDir(),
    file_name)
  file_path = os.path.abspath(file_path)
  return file_path