Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void setupGalasaBoot() throws Exception {
// *** Retrieve the runtime zip from the maven repository
String response = this.shell.issueCommand(
"mvn -B org.apache.maven.plugins:maven-dependency-plugin:2.8:get -Dartifact=dev.galasa:runtime:0.3.0-SNAPSHOT:zip > mvn.log;echo maven-rc=$?");
assertThat(response).as("maven rc search").contains("maven-rc=0"); // check we exited 0
assertThat(response).describedAs("maven rc search").contains("maven-rc=0"); // check we exited 0
Path log = this.homePath.resolve("mvn.log"); // the log file
Path saLog = this.storedArtifactRoot.resolve("mvn.log"); // stored artifact file
Files.copy(log, saLog); // copy it
Expand All @@ -141,7 +141,7 @@ public void setupGalasaBoot() throws Exception {
// *** Unzip the runtime to get the galasa-boot
response = this.shell.issueCommand(
"unzip -o .m2/repository/dev/galasa/runtime/0.3.0-SNAPSHOT/runtime-0.3.0-SNAPSHOT.zip > unzip.log;echo zip-rc=$?");
assertThat(response).as("zip rc search").contains("zip-rc=0"); // check we exited 0
assertThat(response).describedAs("zip rc search").contains("zip-rc=0"); // check we exited 0
log = this.homePath.resolve("unzip.log"); // the log file
saLog = this.storedArtifactRoot.resolve("unzip.log"); // the stored artifact
Files.copy(log, saLog); // copy it
Expand Down Expand Up @@ -182,23 +182,23 @@ public void runCoreIVT() throws Exception {
Path runLog = this.storedArtifactRoot.resolve("coreivt.log"); // the stored artifact
Files.copy(log, runLog); // copy to stored artifacts

assertThat(response).as("run command").contains("galasa-boot-rc=0"); // check we exited 0
assertThat(response).describedAs("run command").contains("galasa-boot-rc=0"); // check we exited 0

assertThat(response).as("check there were no warnings issued").doesNotContain("WARNING"); // make sure java
assertThat(response).describedAs("check there were no warnings issued").doesNotContain("WARNING"); // make sure java
// didnt issue
// warnings;

// *** Pull the run log so we can extract the run name
String sLog = new String(Files.readAllBytes(log));
Matcher matcher = runNamePattern.matcher(sLog);
assertThat(matcher.find()).as("Finding run name in log").isTrue(); // Check that the run name is in the log
assertThat(matcher.find()).describedAs("Finding run name in log").isTrue(); // Check that the run name is in the log
String runName = matcher.group(1);

logger.info("The CoreIVT test was run name " + runName);

// *** Retrieve the Test Structure
Path structureFile = this.homePath.resolve(".galasa/ras/" + runName + "/structure.json");
assertThat(Files.exists(structureFile)).as("Test structure exists on test server for this run").isTrue(); // Check
assertThat(Files.exists(structureFile)).describedAs("Test structure exists on test server for this run").isTrue(); // Check
// that
// the
// test
Expand All @@ -209,7 +209,7 @@ public void runCoreIVT() throws Exception {
TestStructure testStructure = gson.fromJson(sStructure, TestStructure.class);

// *** Check the test passed
assertThat(testStructure.getResult()).as("The test structure indicates the test passes").isEqualTo("Passed");
assertThat(testStructure.getResult()).describedAs("The test structure indicates the test passes").isEqualTo("Passed");

}

Expand All @@ -221,7 +221,7 @@ public void runCoreIVT() throws Exception {
@AfterClass
public void getLogs() throws Exception {
String response = this.shell.issueCommand("zip -r -9 galasa.zip .galasa;echo zip-rc=$?");
assertThat(response).as("zip rc check is 0").contains("zip-rc=0"); // check we exited 0
assertThat(response).describedAs("zip rc check is 0").contains("zip-rc=0"); // check we exited 0

Path zip = this.homePath.resolve("galasa.zip"); // the zip file
Path sazip = this.storedArtifactRoot.resolve("galasa.zip"); // stored artifact file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,20 @@ public void obtainRuntimeFolder() throws Exception {
String response = shell
.issueCommand("docker login -u " + dockerCreds.getUsername() + " -p " + dockerCreds.getPassword()
+ " cicsts-docker-local.artifactory.swg-devops.com/galasa-resources;echo cmd-rc=$?");
assertThat(response).as("Logon Docker").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Logon Docker").contains("cmd-rc=0"); // check we exited 0

// *** Pull the resources image
logger.info("Pulling the resources docker image");
response = shell.issueCommand("docker pull cicsts-docker-local.artifactory.swg-devops.com/galasa-resources:"
+ dockerVersion + ";echo cmd-rc=$?");
assertThat(response).as("Pull resources image").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Pull resources image").contains("cmd-rc=0"); // check we exited 0

// *** run a special container for the purposes of extracting the runtime.zip
logger.info("Starting a testing resource container");
response = shell.issueCommand(
"docker run --name test-resources -d -p 8880:80 cicsts-docker-local.artifactory.swg-devops.com/galasa-resources:"
+ dockerVersion + ";echo cmd-rc=$?");
assertThat(response).as("Start Test Resources image").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Start Test Resources image").contains("cmd-rc=0"); // check we exited 0

// *** Create the test folder
Path testPath = homePath.resolve("galasa-test");
Expand All @@ -159,13 +159,13 @@ public void obtainRuntimeFolder() throws Exception {
response = shell.issueCommand("mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get "
+ "-DrepoUrl=http://127.0.0.1:8880/maven "
+ "-Dartifact=dev.galasa:runtime:0.3.0-SNAPSHOT:zip;echo cmd-rc=$?");
assertThat(response).as("Fetch runtime.zip").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Fetch runtime.zip").contains("cmd-rc=0"); // check we exited 0

// *** Unzip the runtime.zip
logger.info("Unzipping runtime.zip");
response = shell.issueCommand("unzip " + "-d galasa-test "
+ ".m2/repository/dev/galasa/runtime/0.3.0-SNAPSHOT/runtime-0.3.0-SNAPSHOT.zip;echo cmd-rc=$?");
assertThat(response).as("Unzip runtime.zip").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Unzip runtime.zip").contains("cmd-rc=0"); // check we exited 0

logger.info("We now have the runtime.zip ready for building the Galasa Ecosystem");
}
Expand All @@ -179,7 +179,7 @@ public void obtainRuntimeFolder() throws Exception {
public void pullAllImages() throws Exception {
logger.info("Pull all the required images");
String response = shell.issueCommand("bash -e galasa-test/docker/pull.sh;echo cmd-rc=$?", 10 * 60 * 1000);
assertThat(response).as("Pull ecosystem images").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Pull ecosystem images").contains("cmd-rc=0"); // check we exited 0
}

/**
Expand All @@ -191,7 +191,7 @@ public void pullAllImages() throws Exception {
public void createNetwork() throws Exception {
logger.info("Create the Docker Network");
String response = shell.issueCommand("bash -e galasa-test/docker/network.sh;echo cmd-rc=$?");
assertThat(response).as("Create the Docker Network").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Create the Docker Network").contains("cmd-rc=0"); // check we exited 0
}

/**
Expand All @@ -203,7 +203,7 @@ public void createNetwork() throws Exception {
public void createVolumes() throws Exception {
logger.info("Create the Docker Volumes");
String response = shell.issueCommand("bash -e galasa-test/docker/volumes.sh;echo cmd-rc=$?");
assertThat(response).as("Create the Docker Volumes").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Create the Docker Volumes").contains("cmd-rc=0"); // check we exited 0
}

/**
Expand All @@ -215,7 +215,7 @@ public void createVolumes() throws Exception {
public void startResources() throws Exception {
logger.info("Start the Offical Resources Container");
String response = shell.issueCommand("bash -e galasa-test/docker/resources.sh;echo cmd-rc=$?");
assertThat(response).as("Start the Resources Container").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Start the Resources Container").contains("cmd-rc=0"); // check we exited 0

Instant expire = Instant.now();
expire = expire.plusSeconds(120);
Expand All @@ -231,7 +231,7 @@ public void startResources() throws Exception {

Thread.sleep(1000);
}
assertThat(started).as("Resources Container Started").isTrue();
assertThat(started).describedAs("Resources Container Started").isTrue();
}

/**
Expand All @@ -243,7 +243,7 @@ public void startResources() throws Exception {
public void startCps() throws Exception {
logger.info("Start the CPS Container");
String response = shell.issueCommand("bash -e galasa-test/docker/cps-etcd.sh;echo cmd-rc=$?");
assertThat(response).as("Start the CPS Container").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Start the CPS Container").contains("cmd-rc=0"); // check we exited 0

Instant expire = Instant.now();
expire = expire.plusSeconds(120);
Expand All @@ -259,7 +259,7 @@ public void startCps() throws Exception {

Thread.sleep(1000);
}
assertThat(started).as("CPS Started").isTrue();
assertThat(started).describedAs("CPS Started").isTrue();
}

/**
Expand All @@ -272,22 +272,22 @@ public void configureCps() throws Exception {
logger.info("Setting the CPS configuration");
String response = shell
.issueCommand("ETCDCTL_API=3 etcdctl put framework.dynamicstatus.store etcd:http://172.21.0.1:2379");
assertThat(response).as("Set DSS").contains("OK"); // check we exited 0
assertThat(response).describedAs("Set DSS").contains("OK"); // check we exited 0

response = shell
.issueCommand("ETCDCTL_API=3 etcdctl put framework.resultarchive.store couchdb:http://172.21.0.1:5984");
assertThat(response).as("Set RAS").contains("OK"); // check we exited 0
assertThat(response).describedAs("Set RAS").contains("OK"); // check we exited 0

response = shell
.issueCommand("ETCDCTL_API=3 etcdctl put framework.credentials.store etcd:http://172.21.0.1:2379");
assertThat(response).as("Set CREDS").contains("OK"); // check we exited 0
assertThat(response).describedAs("Set CREDS").contains("OK"); // check we exited 0

response = shell
.issueCommand("ETCDCTL_API=3 etcdctl put framework.resource.management.dead.heartbeat.timeout 60");
assertThat(response).as("Set heartbeat timeout").contains("OK"); // check we exited 0
assertThat(response).describedAs("Set heartbeat timeout").contains("OK"); // check we exited 0

response = shell.issueCommand("ETCDCTL_API=3 etcdctl put framework.resource.management.finished.timeout 60");
assertThat(response).as("Set finished timeout").contains("OK"); // check we exited 0
assertThat(response).describedAs("Set finished timeout").contains("OK"); // check we exited 0
}

/**
Expand All @@ -299,11 +299,11 @@ public void configureCps() throws Exception {
public void startRas() throws Exception {
logger.info("Initialise the RAS Couchdb volume");
String response = shell.issueCommand("bash -e galasa-test/docker/ras-couchdb-init.sh;echo cmd-rc=$?");
assertThat(response).as("Initialise the RAS Volume").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Initialise the RAS Volume").contains("cmd-rc=0"); // check we exited 0

logger.info("Start the RAS Container");
response = shell.issueCommand("cd galasa-test/docker;bash -e ras-couchdb.sh;echo cmd-rc=$?");
assertThat(response).as("Start the RAS Container").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Start the RAS Container").contains("cmd-rc=0"); // check we exited 0

Instant expire = Instant.now();
expire = expire.plusSeconds(120);
Expand All @@ -319,7 +319,7 @@ public void startRas() throws Exception {

Thread.sleep(1000);
}
assertThat(started).as("RAS Started").isTrue();
assertThat(started).describedAs("RAS Started").isTrue();
}

/**
Expand All @@ -331,7 +331,7 @@ public void startRas() throws Exception {
public void startApi() throws Exception {
logger.info("Start the API Container");
String response = shell.issueCommand("cd galasa-test/docker;bash -e api.sh;echo cmd-rc=$?");
assertThat(response).as("Start the API Container").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Start the API Container").contains("cmd-rc=0"); // check we exited 0

Instant expire = Instant.now();
expire = expire.plusSeconds(120);
Expand All @@ -348,7 +348,7 @@ public void startApi() throws Exception {

Thread.sleep(1000);
}
assertThat(started).as("API Started").isTrue();
assertThat(started).describedAs("API Started").isTrue();
}

/**
Expand All @@ -360,7 +360,7 @@ public void startApi() throws Exception {
public void startResMon() throws Exception {
logger.info("Start the ResMon Container");
String response = shell.issueCommand("cd galasa-test/docker;bash -e resource-monitor.sh;echo cmd-rc=$?");
assertThat(response).as("Start the ResMon Container").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Start the ResMon Container").contains("cmd-rc=0"); // check we exited 0

Instant expire = Instant.now();
expire = expire.plusSeconds(120);
Expand All @@ -376,7 +376,7 @@ public void startResMon() throws Exception {

Thread.sleep(1000);
}
assertThat(started).as("ResMon Started").isTrue();
assertThat(started).describedAs("ResMon Started").isTrue();
}

/**
Expand All @@ -388,7 +388,7 @@ public void startResMon() throws Exception {
public void startController() throws Exception {
logger.info("Start the Docker Controller Container");
String response = shell.issueCommand("cd galasa-test/docker;bash -e controller.sh;echo cmd-rc=$?");
assertThat(response).as("Start the Docker Controller Container").contains("cmd-rc=0"); // check we exited 0
assertThat(response).describedAs("Start the Docker Controller Container").contains("cmd-rc=0"); // check we exited 0

Instant expire = Instant.now();
expire = expire.plusSeconds(120);
Expand All @@ -404,7 +404,7 @@ public void startController() throws Exception {

Thread.sleep(1000);
}
assertThat(started).as("Docker Controller Started").isTrue();
assertThat(started).describedAs("Docker Controller Started").isTrue();
}

/**
Expand Down Expand Up @@ -432,7 +432,7 @@ public void runCoreIVT() throws Exception {

Thread.sleep(1000);
}
assertThat(started).as("CoreIVT Finished").isTrue();
assertThat(started).describedAs("CoreIVT Finished").isTrue();

// TODO Check if passed and retrieve the run log
// TODO Cant do that until the couchdb ras records the id in the dss
Expand Down Expand Up @@ -478,7 +478,7 @@ public void runAllIVTs() throws Exception {

Thread.sleep(1000);
}
assertThat(finished).as("All runs finished").isTrue();
assertThat(finished).describedAs("All runs finished").isTrue();

// TODO Check each run passed and retrieve the run log
// TODO Cant do that until the couchdb ras records the id in the dss
Expand Down Expand Up @@ -516,7 +516,7 @@ public void checkRunFinishedCleanup() throws Exception {

Thread.sleep(1000);
}
assertThat(deleted).as("All runs deleted").isTrue();
assertThat(deleted).describedAs("All runs deleted").isTrue();
}

/**
Expand Down Expand Up @@ -557,7 +557,7 @@ public void checkRunContainerCleanup() throws Exception {

Thread.sleep(1000);
}
assertThat(deleted).as("All run containers deleted").isTrue();
assertThat(deleted).describedAs("All run containers deleted").isTrue();
}

// TODO Further integration testing
Expand Down Expand Up @@ -600,7 +600,7 @@ private void submitTest(String bundle, String test, String runName) throws IpNet
private void putRunProperty(String runName, String property, String value) throws IpNetworkManagerException {
String response = shell.issueCommand(
"ETCDCTL_API=3 etcdctl put dss.framework.run." + runName + "." + property + " '" + value + "'");
assertThat(response).as("PUT was OK").contains("OK"); // check we exited 0
assertThat(response).describedAs("PUT was OK").contains("OK"); // check we exited 0
}

// TODO retrieve all the RAS and docker logs etc
Expand All @@ -612,7 +612,7 @@ private void putRunProperty(String runName, String property, String value) throw
// @AfterClass
// public void getLogs() throws Exception {
// String response = this.shell.issueCommand("zip -r -9 galasa.zip .galasa;echo zip-rc=$?");
// assertThat(response).as("zip rc check is 0").contains("zip-rc=0"); // check we exited 0
// assertThat(response).describedAs("zip rc check is 0").contains("zip-rc=0"); // check we exited 0
//
// Path zip = this.homePath.resolve("galasa.zip"); // the zip file
// Path sazip = this.storedArtifactRoot.resolve("galasa.zip"); // stored artifact file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void testArtifactIvtTest() throws Exception {

String result = run.get("result").getAsString();

assertThat(result).as("The test indicates the test passes").isEqualTo("Passed");
assertThat(result).describedAs("The test indicates the test passes").isEqualTo("Passed");
}

abstract protected IGenericEcosystem getEcosystem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void testCoreIvtTest() throws Exception {

String result = run.get("result").getAsString();

assertThat(result).as("The test indicates the test passes").isEqualTo("Passed");
assertThat(result).describedAs("The test indicates the test passes").isEqualTo("Passed");
}

abstract protected IGenericEcosystem getEcosystem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testDockerIvtTest() throws Exception {

String result = run.get("result").getAsString();

assertThat(result).as("The test indicates the test passes").isEqualTo("Passed");
assertThat(result).describedAs("The test indicates the test passes").isEqualTo("Passed");
}

abstract protected IGenericEcosystem getEcosystem() throws Exception;
Expand Down
Loading
Loading