Пример #1
0
  @BeforeClass(description = "init: create org stuff")
  public void setUp() {
    SSHCommandResult res;
    String uid = KatelloUtils.getUniqueID();
    this.organization = "ak-" + uid;
    this.env = "ak-" + uid;

    KatelloOrg org = new KatelloOrg(this.organization, null);
    res = org.cli_create();
    Assert.assertTrue(res.getExitCode().intValue() == 0, "Check - return code");
    KatelloEnvironment env =
        new KatelloEnvironment(this.env, null, this.organization, KatelloEnvironment.LIBRARY);
    res = env.cli_create();
    Assert.assertTrue(res.getExitCode().intValue() == 0, "Check - return code");
  }
Пример #2
0
  @BeforeClass(description = "Generate unique objects")
  public void setUp() {
    String uid = KatelloUtils.getUniqueID();
    org_name = "org" + uid;
    provider_name = "provider" + uid;
    product_name = "product" + uid;
    repo_name = "repo" + uid;
    env_name = "env" + uid;

    // Create org:
    KatelloOrg org = new KatelloOrg(this.org_name, "Package tests");
    exec_result = org.cli_create();
    Assert.assertTrue(exec_result.getExitCode() == 0, "Check - return code");

    // Create provider:
    KatelloProvider prov = new KatelloProvider(provider_name, org_name, "Package provider", null);
    exec_result = prov.create();
    Assert.assertTrue(exec_result.getExitCode() == 0, "Check - return code");

    // Create product:
    KatelloProduct prod =
        new KatelloProduct(product_name, org_name, provider_name, null, null, null, null, null);
    exec_result = prod.create();
    Assert.assertTrue(exec_result.getExitCode() == 0, "Check - return code");

    exec_result = prod.cli_list();
    product_Id = KatelloCli.grepCLIOutput("ID", getOutput(exec_result).trim(), 1);

    KatelloRepo repo =
        new KatelloRepo(repo_name, org_name, product_name, REPO_INECAS_ZOO3, null, null);
    exec_result = repo.create();
    Assert.assertTrue(exec_result.getExitCode() == 0, "Check - return code");

    KatelloEnvironment env =
        new KatelloEnvironment(env_name, null, org_name, KatelloEnvironment.LIBRARY);
    exec_result = env.cli_create();
    Assert.assertTrue(exec_result.getExitCode() == 0, "Check - return code");

    prov.synchronize();

    content_view =
        KatelloUtils.promoteRepoToEnvironment(org_name, product_name, repo_name, env_name);
  }