summaryrefslogtreecommitdiffstats
path: root/node-maintainer
diff options
context:
space:
mode:
authorsindre <sindre.grostad@icloud.com>2017-08-08 09:57:56 +0200
committerOla Aunrønning <olaa@yahoo-inc.com>2017-08-15 12:29:31 +0200
commita35a0269bf5b22f815fc51aa6809361c7b87dbf9 (patch)
tree4321fd31f0ef61b19e99aa5d9e8d86982d793788 /node-maintainer
parent723356e11c626a8e40f6cd7b309678d3f9cc5adc (diff)
Added verificationReport test and removed skipwords in parseInstructions
Diffstat (limited to 'node-maintainer')
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/report/VerificationReportTest.java22
-rw-r--r--node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/resources/reportJSON2
2 files changed, 15 insertions, 9 deletions
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/report/VerificationReportTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/report/VerificationReportTest.java
index b061966d445..beea4405ef9 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/report/VerificationReportTest.java
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/report/VerificationReportTest.java
@@ -11,23 +11,29 @@ import static org.junit.Assert.*;
public class VerificationReportTest {
private VerificationReport verificationReport;
- private static final String YAMAS_REPORT_PATH = "src/test/java/com/yahoo/vespa/hosted/node/verification/spec/resources/reportJSON";
-
+ private static final String REPORT_PATH = "src/test/java/com/yahoo/vespa/hosted/node/verification/spec/resources/reportJSON";
@Before
public void setup() {
verificationReport = new VerificationReport();
+ }
+
+ @Test
+ public void VerificationReport_returns_empty_string_when_all_specs_are_correct() throws Exception {
+ String expectedJson = "{}";
+ ObjectMapper om = new ObjectMapper();
+ String actualJson = om.writeValueAsString(verificationReport);
+ assertEquals(expectedJson, actualJson);
+ }
+ @Test
+ public void Json_is_in_wanted_format_when_all_specs_are_wrong() throws Exception {
verificationReport.setActualInterfaceSpeed(100D);
verificationReport.setActualDiskSpaceAvailable(500D);
verificationReport.setActualDiskType(HardwareInfo.DiskType.FAST);
verificationReport.setActualMemoryAvailable(123D);
verificationReport.setActualcpuCores(4);
- }
-
- @Test
- public void Json_is_in_wanted_format() throws Exception {
-
- String expectedJson = MockCommandExecutor.readFromFile(YAMAS_REPORT_PATH).get(0);
+ verificationReport.setFaultyIpAddresses(new String[]{"2001:4998:44:505d:0:0:0:2618"});
+ String expectedJson = MockCommandExecutor.readFromFile(REPORT_PATH).get(0);
ObjectMapper om = new ObjectMapper();
String actualJson = om.writeValueAsString(verificationReport);
assertEquals(expectedJson, actualJson);
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/resources/reportJSON b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/resources/reportJSON
index c9e07ddcaa9..9b874f1be68 100644
--- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/resources/reportJSON
+++ b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/spec/resources/reportJSON
@@ -1 +1 @@
-{"actualMemoryAvailable":123.0,"actualDiskType":"FAST","actualDiskSpaceAvailable":500.0,"actualInterfaceSpeed":100.0,"actualcpuCores":4} \ No newline at end of file
+{"actualMemoryAvailable":123.0,"actualDiskType":"FAST","actualDiskSpaceAvailable":500.0,"actualInterfaceSpeed":100.0,"actualcpuCores":4,"faultyIpAddresses":["2001:4998:44:505d:0:0:0:2618"]} \ No newline at end of file