summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-09-26 07:53:33 +0300
committerIttay Stern <ittay.stern@att.com>2019-09-26 07:53:33 +0300
commitdcf470807a0dc13a14a8948f3879406e84f09df2 (patch)
tree97e872be6c114b79c0c1b39e4d8047348ce2fc12
parent16b52c71ed49b9cd6ffa2cd1383d1b6c7724e17f (diff)
Disable Test Administration Script where old `wget`
Change-Id: I4bace8cf4eeba84ad13794e2abe9d5e525dc91ea Issue-ID: VID-638 Signed-off-by: Ittay Stern <ittay.stern@att.com>
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/scripts/AdministrationScriptsTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/scripts/AdministrationScriptsTest.java b/vid-app-common/src/test/java/org/onap/vid/scripts/AdministrationScriptsTest.java
index ddd28fd82..31dcea0f8 100644
--- a/vid-app-common/src/test/java/org/onap/vid/scripts/AdministrationScriptsTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/scripts/AdministrationScriptsTest.java
@@ -56,6 +56,11 @@ public class AdministrationScriptsTest {
@Test
public void categoryParameterSh_addReleaseCategory_PostAsExpected() throws Exception {
+ if (localWgetNotCompatible()) {
+ // cannot perform the test on hosting machine
+ return;
+ }
+
final StubServer stubServer = new StubServer();
final URI scriptSource = AdministrationScriptsTest.class
.getResource("/scripts/category_parameter.sh").toURI();
@@ -100,6 +105,13 @@ public class AdministrationScriptsTest {
}
}
+ private boolean localWgetNotCompatible() throws IOException, InterruptedException {
+ // we need versions > 1.14
+ Pair<Integer, String> wgetVersion = exec("wget --version");
+ return wgetVersion.getLeft() != 0 ||
+ Pattern.compile(".*GNU Wget 1.1[0-4].*", Pattern.DOTALL).matcher(wgetVersion.getRight()).matches();
+ }
+
private Path createTempFile(String text) throws IOException {
Path input = Files.createTempFile("input", ".txt");
return Files.write(input, ImmutableList.of(text));