Search in sources :

Example 1 with IndyKojiClientModule

use of org.commonjava.indy.koji.client.IndyKojiClientModule in project indy by Commonjava.

the class RepairKojiRepositoryTest method run.

/**
 * For this test to pass, below settings are needed in koji.conf:
 *
 * tag.patterns.enabled=false
 * proxy.binary.builds=true
 */
@Ignore
@Test
public void run() throws Exception {
    // 0. trigger koji repo creation
    contentDownloadTime(pseudoGroupName, path);
    contentDownloadTime(pseudoGroupName, binaryPath);
    List<RemoteRepository> repos = getKojiRemoteRepositories();
    RemoteRepository repository = null;
    RemoteRepository repositoryBinary = null;
    for (RemoteRepository r : repos) {
        String name = r.getName();
        if (name.startsWith(KOJI_ORIGIN_BINARY)) {
            repositoryBinary = r;
        } else {
            repository = r;
        }
    }
    assertThat(repositoryBinary, notNullValue());
    assertThat(repository, notNullValue());
    // 1. repair remote
    IndyKojiClientModule module = client.module(IndyKojiClientModule.class);
    KojiRepairResult ret = module.repairVol("maven", remote, repository.getName(), true);
    boolean succeeded = ret.succeeded();
    assertTrue(succeeded);
    printResults(ret);
    // 2. repair group
    String groupName = "brew-proxies";
    ret = module.repairVol("maven", group, groupName, true);
    succeeded = ret.succeeded();
    assertTrue(succeeded);
    printResults(ret);
}
Also used : IndyKojiClientModule(org.commonjava.indy.koji.client.IndyKojiClientModule) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) KojiRepairResult(org.commonjava.indy.koji.model.KojiRepairResult) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

IndyKojiClientModule (org.commonjava.indy.koji.client.IndyKojiClientModule)1 KojiRepairResult (org.commonjava.indy.koji.model.KojiRepairResult)1 RemoteRepository (org.commonjava.indy.model.core.RemoteRepository)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1