Separate distro tests to be per distribution (#45565)
The java based distribution tests currently have a single Tests class which encapsulates all of the tests for a particular distribution. The test task in gradle then depends on all distributions being built, and each individual tests class looks for the particular distribution it is trying to test. This means that reproducing a single test failure triggers all the distributions to be built, even though only one is needed for the test. This commit reworks the java distribution tests to pass in a particular distribution to be tested, and changes the base test classes to be actual test classes which have assumptions around which distributions they operate on. For example, the archives tests will be skipped when run with an rpm distribution, and vice versa for the package tests. This makes reproduction much more granular. It also also better splitting up tests around a particular use case. For example, all tests for systemd behavior can be in one test class, and run independently of all tests against rpm/deb distributions.
This commit is contained in:
parent
2a0c7c40e5
commit
18fb63209b
|
@ -36,6 +36,7 @@ import org.elasticsearch.gradle.vagrant.VagrantExtension;
|
|||
import org.gradle.api.NamedDomainObjectContainer;
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.Task;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.file.Directory;
|
||||
import org.gradle.api.plugins.ExtraPropertiesExtension;
|
||||
|
@ -74,6 +75,7 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
private static final String COPY_UPGRADE_TASK = "copyUpgradePackages";
|
||||
private static final String COPY_PLUGINS_TASK = "copyPlugins";
|
||||
private static final String IN_VM_SYSPROP = "tests.inVM";
|
||||
private static final String DISTRIBUTION_SYSPROP = "tests.distribution";
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
|
@ -88,14 +90,15 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
Provider<Directory> upgradeDir = project.getLayout().getBuildDirectory().dir("packaging/upgrade");
|
||||
Provider<Directory> pluginsDir = project.getLayout().getBuildDirectory().dir("packaging/plugins");
|
||||
|
||||
configureDistributions(project, upgradeVersion);
|
||||
List<ElasticsearchDistribution> distributions = configureDistributions(project, upgradeVersion);
|
||||
TaskProvider<Copy> copyDistributionsTask = configureCopyDistributionsTask(project, distributionsDir);
|
||||
TaskProvider<Copy> copyUpgradeTask = configureCopyUpgradeTask(project, upgradeVersion, upgradeDir);
|
||||
TaskProvider<Copy> copyPluginsTask = configureCopyPluginsTask(project, pluginsDir);
|
||||
|
||||
Map<String, TaskProvider<?>> distroTests = new HashMap<>();
|
||||
Map<String, TaskProvider<?>> batsTests = new HashMap<>();
|
||||
distroTests.put("distribution", configureDistroTest(project, distributionsDir, copyDistributionsTask));
|
||||
for (ElasticsearchDistribution distribution : distributions) {
|
||||
configureDistroTest(project, distribution);
|
||||
}
|
||||
batsTests.put("bats oss", configureBatsTest(project, "oss", distributionsDir, copyDistributionsTask));
|
||||
batsTests.put("bats default", configureBatsTest(project, "default", distributionsDir, copyDistributionsTask));
|
||||
configureBatsTest(project, "plugins",distributionsDir, copyDistributionsTask, copyPluginsTask).configure(t ->
|
||||
|
@ -108,17 +111,27 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
vmProject.getPluginManager().apply(VagrantBasePlugin.class);
|
||||
vmProject.getPluginManager().apply(JdkDownloadPlugin.class);
|
||||
List<Object> vmDependencies = new ArrayList<>(configureVM(vmProject));
|
||||
// a hack to ensure the parent task has already been run. this will not be necessary once tests are per distribution
|
||||
// which will eliminate the copy distributions task altogether
|
||||
vmDependencies.add(copyDistributionsTask);
|
||||
vmDependencies.add(project.getConfigurations().getByName("testRuntimeClasspath"));
|
||||
|
||||
distroTests.forEach((desc, task) -> configureVMWrapperTask(vmProject, desc, task.getName(), vmDependencies));
|
||||
VagrantExtension vagrant = vmProject.getExtensions().getByType(VagrantExtension.class);
|
||||
TaskProvider<Task> distroTest = vmProject.getTasks().register("distroTest");
|
||||
for (ElasticsearchDistribution distribution : distributions) {
|
||||
String destructiveTaskName = destructiveDistroTestTaskName(distribution);
|
||||
Platform platform = distribution.getPlatform();
|
||||
// this condition ensures windows boxes get windows distributions, and linux boxes get linux distributions
|
||||
if (isWindows(vmProject) == (platform == Platform.WINDOWS)) {
|
||||
TaskProvider<GradleDistroTestTask> vmTask =
|
||||
configureVMWrapperTask(vmProject, distribution.getName() + " distribution", destructiveTaskName, vmDependencies);
|
||||
vmTask.configure(t -> t.dependsOn(distribution));
|
||||
distroTest.configure(t -> t.dependsOn(vmTask));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
batsTests.forEach((desc, task) -> {
|
||||
configureVMWrapperTask(vmProject, desc, task.getName(), vmDependencies).configure(t -> {
|
||||
t.setProgressHandler(new BatsProgressLogger(project.getLogger()));
|
||||
t.onlyIf(spec -> vagrant.isWindowsVM() == false); // bats doesn't run on windows
|
||||
t.onlyIf(spec -> isWindows(vmProject) == false); // bats doesn't run on windows
|
||||
t.dependsOn(copyDistributionsTask);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -166,7 +179,7 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
VagrantExtension vagrant = project.getExtensions().getByType(VagrantExtension.class);
|
||||
vagrant.setBox(box);
|
||||
vagrant.vmEnv("PATH", convertPath(project, vagrant, gradleJdk, "/bin:$PATH", "\\bin;$Env:PATH"));
|
||||
vagrant.setIsWindowsVM(box.contains("windows"));
|
||||
vagrant.setIsWindowsVM(isWindows(project));
|
||||
|
||||
return Arrays.asList(gradleJdk);
|
||||
}
|
||||
|
@ -271,15 +284,14 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
});
|
||||
}
|
||||
|
||||
private static TaskProvider<?> configureDistroTest(Project project, Provider<Directory> distributionsDir,
|
||||
TaskProvider<Copy> copyPackagingArchives) {
|
||||
// TODO: don't run with security manager...
|
||||
return project.getTasks().register("destructiveDistroTest", Test.class,
|
||||
private static TaskProvider<?> configureDistroTest(Project project, ElasticsearchDistribution distribution) {
|
||||
return project.getTasks().register(destructiveDistroTestTaskName(distribution), Test.class,
|
||||
t -> {
|
||||
t.setMaxParallelForks(1);
|
||||
t.setWorkingDir(distributionsDir);
|
||||
t.setWorkingDir(project.getProjectDir());
|
||||
t.systemProperty(DISTRIBUTION_SYSPROP, distribution.toString());
|
||||
if (System.getProperty(IN_VM_SYSPROP) == null) {
|
||||
t.dependsOn(copyPackagingArchives);
|
||||
t.dependsOn(distribution);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -299,7 +311,7 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
});
|
||||
}
|
||||
|
||||
private void configureDistributions(Project project, Version upgradeVersion) {
|
||||
private List<ElasticsearchDistribution> configureDistributions(Project project, Version upgradeVersion) {
|
||||
NamedDomainObjectContainer<ElasticsearchDistribution> distributions = DistributionDownloadPlugin.getContainer(project);
|
||||
List<ElasticsearchDistribution> currentDistros = new ArrayList<>();
|
||||
List<ElasticsearchDistribution> upgradeDistros = new ArrayList<>();
|
||||
|
@ -337,13 +349,15 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
List<Configuration> distroUpgradeConfigs = upgradeDistros.stream().map(ElasticsearchDistribution::getConfiguration)
|
||||
.collect(Collectors.toList());
|
||||
packagingUpgradeConfig.setExtendsFrom(distroUpgradeConfigs);
|
||||
|
||||
return currentDistros;
|
||||
}
|
||||
|
||||
private static void addDistro(NamedDomainObjectContainer<ElasticsearchDistribution> distributions,
|
||||
Type type, Platform platform, Flavor flavor, boolean bundledJdk, String version,
|
||||
List<ElasticsearchDistribution> container) {
|
||||
|
||||
String name = flavor + "-" + (type == Type.ARCHIVE ? platform + "-" : "") + type + (bundledJdk ? "" : "-no-jdk") + "-" + version;
|
||||
String name = distroId(type, platform, flavor, bundledJdk) + "-" + version;
|
||||
if (distributions.findByName(name) != null) {
|
||||
return;
|
||||
}
|
||||
|
@ -358,4 +372,17 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
});
|
||||
container.add(distro);
|
||||
}
|
||||
|
||||
// return true if the project is for a windows VM, false otherwise
|
||||
private static boolean isWindows(Project project) {
|
||||
return project.getName().contains("windows");
|
||||
}
|
||||
|
||||
private static String distroId(Type type, Platform platform, Flavor flavor, boolean bundledJdk) {
|
||||
return flavor + "-" + (type == Type.ARCHIVE ? platform + "-" : "") + type + (bundledJdk ? "" : "-no-jdk");
|
||||
}
|
||||
|
||||
private static String destructiveDistroTestTaskName(ElasticsearchDistribution distro) {
|
||||
return "destructiveDistroTest." + distroId(distro.getType(), distro.getPlatform(), distro.getFlavor(), distro.getBundledJdk());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging;
|
||||
|
||||
import org.junit.runner.JUnitCore;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
/**
|
||||
* Ensures that the current JVM is running on a virtual machine before delegating to {@link JUnitCore}. We just check for the existence
|
||||
* of a special file that we create during VM provisioning.
|
||||
*/
|
||||
public class VMTestRunner {
|
||||
public static void main(String[] args) {
|
||||
if (Files.exists(Paths.get("/is_vagrant_vm"))) {
|
||||
JUnitCore.main(args);
|
||||
} else {
|
||||
throw new RuntimeException("This filesystem does not have an expected marker file indicating it's a virtual machine. These " +
|
||||
"tests should only run in a virtual machine because they're destructive.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.TestCaseOrdering;
|
||||
import org.apache.http.client.fluent.Request;
|
||||
import org.elasticsearch.packaging.util.Archives;
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
@ -29,6 +28,7 @@ import org.elasticsearch.packaging.util.Platforms;
|
|||
import org.elasticsearch.packaging.util.ServerUtils;
|
||||
import org.elasticsearch.packaging.util.Shell;
|
||||
import org.elasticsearch.packaging.util.Shell.Result;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
@ -55,13 +55,15 @@ import static org.hamcrest.CoreMatchers.not;
|
|||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.hamcrest.Matchers.isEmptyString;
|
||||
import static org.junit.Assume.assumeThat;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
/**
|
||||
* Tests that apply to the archive distributions (tar, zip). To add a case for a distribution, subclass and
|
||||
* override {@link ArchiveTestCase#distribution()}. These tests should be the same across all archive distributions
|
||||
*/
|
||||
@TestCaseOrdering(TestCaseOrdering.AlphabeticOrder.class)
|
||||
public abstract class ArchiveTestCase extends PackagingTestCase {
|
||||
public class ArchiveTests extends PackagingTestCase {
|
||||
|
||||
@BeforeClass
|
||||
public static void assumptions() {
|
||||
assumeTrue("only archive distributions",
|
||||
distribution().packaging == Distribution.Packaging.TAR || distribution().packaging == Distribution.Packaging.ZIP);
|
||||
}
|
||||
|
||||
public void test10Install() throws Exception {
|
||||
installation = installArchive(distribution());
|
||||
|
@ -366,7 +368,7 @@ public abstract class ArchiveTestCase extends PackagingTestCase {
|
|||
final Installation.Executables bin = installation.executables();
|
||||
final Shell sh = newShell();
|
||||
|
||||
if (distribution().equals(Distribution.DEFAULT_LINUX) || distribution().equals(Distribution.DEFAULT_WINDOWS)) {
|
||||
if (distribution().isDefault()) {
|
||||
assertTrue(Files.exists(installation.lib.resolve("tools").resolve("security-cli")));
|
||||
final Platforms.PlatformAction action = () -> {
|
||||
Result result = sh.run(bin.elasticsearchCertutil + " --help");
|
||||
|
@ -379,7 +381,7 @@ public abstract class ArchiveTestCase extends PackagingTestCase {
|
|||
};
|
||||
Platforms.onLinux(action);
|
||||
Platforms.onWindows(action);
|
||||
} else if (distribution().equals(Distribution.OSS_LINUX) || distribution().equals(Distribution.OSS_WINDOWS)) {
|
||||
} else {
|
||||
assertFalse(Files.exists(installation.lib.resolve("tools").resolve("security-cli")));
|
||||
}
|
||||
}
|
||||
|
@ -395,7 +397,8 @@ public abstract class ArchiveTestCase extends PackagingTestCase {
|
|||
assertThat(result.stdout, containsString("A CLI tool to remove corrupted parts of unrecoverable shards"));
|
||||
};
|
||||
|
||||
if (distribution().equals(Distribution.DEFAULT_LINUX) || distribution().equals(Distribution.DEFAULT_WINDOWS)) {
|
||||
// TODO: this should be checked on all distributions
|
||||
if (distribution().isDefault()) {
|
||||
Platforms.onLinux(action);
|
||||
Platforms.onWindows(action);
|
||||
}
|
||||
|
@ -413,7 +416,8 @@ public abstract class ArchiveTestCase extends PackagingTestCase {
|
|||
containsString("A CLI tool to do unsafe cluster and index manipulations on current node"));
|
||||
};
|
||||
|
||||
if (distribution().equals(Distribution.DEFAULT_LINUX) || distribution().equals(Distribution.DEFAULT_WINDOWS)) {
|
||||
// TODO: this should be checked on all distributions
|
||||
if (distribution().isDefault()) {
|
||||
Platforms.onLinux(action);
|
||||
Platforms.onWindows(action);
|
||||
}
|
||||
|
@ -458,7 +462,8 @@ public abstract class ArchiveTestCase extends PackagingTestCase {
|
|||
containsString("Manages elasticsearch file users"));
|
||||
};
|
||||
|
||||
if (distribution().equals(Distribution.DEFAULT_LINUX) || distribution().equals(Distribution.DEFAULT_WINDOWS)) {
|
||||
// TODO: this should be checked on all distributions
|
||||
if (distribution().isDefault()) {
|
||||
Platforms.onLinux(action);
|
||||
Platforms.onWindows(action);
|
||||
}
|
|
@ -21,15 +21,12 @@ package org.elasticsearch.packaging.test;
|
|||
|
||||
import com.carrotsearch.randomizedtesting.annotations.TestCaseOrdering;
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
import org.elasticsearch.packaging.util.Installation;
|
||||
import org.elasticsearch.packaging.util.Shell;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static org.elasticsearch.packaging.util.Cleanup.cleanEverything;
|
||||
import static org.elasticsearch.packaging.util.FileUtils.assertPathsDontExist;
|
||||
import static org.elasticsearch.packaging.util.FileUtils.assertPathsExist;
|
||||
import static org.elasticsearch.packaging.util.Packages.SYSVINIT_SCRIPT;
|
||||
|
@ -46,21 +43,13 @@ import static org.junit.Assume.assumeThat;
|
|||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
@TestCaseOrdering(TestCaseOrdering.AlphabeticOrder.class)
|
||||
public abstract class DebPreservationTestCase extends PackagingTestCase {
|
||||
|
||||
private static Installation installation;
|
||||
|
||||
protected abstract Distribution distribution();
|
||||
|
||||
@BeforeClass
|
||||
public static void cleanup() throws Exception {
|
||||
installation = null;
|
||||
cleanEverything();
|
||||
}
|
||||
public class DebPreservationTests extends PackagingTestCase {
|
||||
|
||||
@Before
|
||||
public void onlyCompatibleDistributions() {
|
||||
assumeTrue("only dpkg platforms", isDPKG());
|
||||
assumeTrue("deb distributions", distribution().packaging == Distribution.Packaging.DEB);
|
||||
assumeTrue("only bundled jdk", distribution().hasJdk);
|
||||
assumeTrue("only compatible distributions", distribution().packaging.compatible);
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultDebBasicTests extends PackageTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_DEB;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultDebPreservationTests extends DebPreservationTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_DEB;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultLinuxTarTests extends ArchiveTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_LINUX;
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultNoJdkDebBasicTests extends PackageTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_NO_JDK_DEB;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultNoJdkLinuxTarTests extends ArchiveTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_NO_JDK_LINUX;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultNoJdkRpmBasicTests extends PackageTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_NO_JDK_RPM;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultNoJdkWindowsZipTests extends ArchiveTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_NO_JDK_WINDOWS;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultRpmBasicTests extends PackageTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_RPM;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultRpmPreservationTests extends RpmPreservationTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_RPM;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultWindowsServiceTests extends WindowsServiceTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_WINDOWS;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class DefaultWindowsZipTests extends ArchiveTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.DEFAULT_WINDOWS;
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
import org.elasticsearch.packaging.util.Platforms;
|
||||
import org.elasticsearch.packaging.util.Shell;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.elasticsearch.packaging.util.Distribution.DEFAULT_DEB;
|
||||
import static org.elasticsearch.packaging.util.Distribution.OSS_DEB;
|
||||
import static org.elasticsearch.packaging.util.FileUtils.getDistributionFile;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
public class OssDebBasicTests extends PackageTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_DEB;
|
||||
}
|
||||
|
||||
public void test11DebDependencies() {
|
||||
assumeTrue(Platforms.isDPKG());
|
||||
|
||||
final Shell sh = new Shell();
|
||||
|
||||
final Shell.Result defaultResult = sh.run("dpkg -I " + getDistributionFile(DEFAULT_DEB));
|
||||
final Shell.Result ossResult = sh.run("dpkg -I " + getDistributionFile(OSS_DEB));
|
||||
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^ Depends:.*bash.*").matcher(defaultResult.stdout).find());
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^ Depends:.*bash.*").matcher(ossResult.stdout).find());
|
||||
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^ Conflicts: elasticsearch-oss$").matcher(defaultResult.stdout).find());
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^ Conflicts: elasticsearch$").matcher(ossResult.stdout).find());
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssDebPreservationTests extends DebPreservationTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_DEB;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssLinuxTarTests extends ArchiveTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_LINUX;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssNoJdkDebBasicTests extends PackageTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_NO_JDK_DEB;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssNoJdkLinuxTarTests extends ArchiveTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_NO_JDK_LINUX;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssNoJdkRpmBasicTests extends PackageTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_NO_JDK_RPM;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssNoJdkWindowsZipTests extends ArchiveTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_NO_JDK_WINDOWS;
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
import org.elasticsearch.packaging.util.Platforms;
|
||||
import org.elasticsearch.packaging.util.Shell;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.elasticsearch.packaging.util.Distribution.DEFAULT_RPM;
|
||||
import static org.elasticsearch.packaging.util.Distribution.OSS_RPM;
|
||||
import static org.elasticsearch.packaging.util.FileUtils.getDistributionFile;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
public class OssRpmBasicTests extends PackageTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_RPM;
|
||||
}
|
||||
|
||||
public void test11RpmDependencies() {
|
||||
assumeTrue(Platforms.isRPM());
|
||||
|
||||
final Shell sh = new Shell();
|
||||
|
||||
final Shell.Result defaultDeps = sh.run("rpm -qpR " + getDistributionFile(DEFAULT_RPM));
|
||||
final Shell.Result ossDeps = sh.run("rpm -qpR " + getDistributionFile(OSS_RPM));
|
||||
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^/bin/bash\\s*$").matcher(defaultDeps.stdout).find());
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^/bin/bash\\s*$").matcher(ossDeps.stdout).find());
|
||||
|
||||
final Shell.Result defaultConflicts = sh.run("rpm -qp --conflicts " + getDistributionFile(DEFAULT_RPM));
|
||||
final Shell.Result ossConflicts = sh.run("rpm -qp --conflicts " + getDistributionFile(OSS_RPM));
|
||||
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^elasticsearch-oss\\s*$").matcher(defaultConflicts.stdout).find());
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^elasticsearch\\s*$").matcher(ossConflicts.stdout).find());
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssRpmPreservationTests extends RpmPreservationTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_RPM;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssWindowsServiceTests extends WindowsServiceTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_WINDOWS;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
|
||||
public class OssWindowsZipTests extends ArchiveTestCase {
|
||||
|
||||
@Override
|
||||
protected Distribution distribution() {
|
||||
return Distribution.OSS_WINDOWS;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.packaging.test;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
import org.elasticsearch.packaging.util.Platforms;
|
||||
import org.elasticsearch.packaging.util.Shell;
|
||||
import org.junit.Before;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.elasticsearch.packaging.util.FileUtils.getDistributionFile;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
public class PackageConflictTests extends PackagingTestCase {
|
||||
|
||||
private Shell sh;
|
||||
|
||||
@Before
|
||||
public void onlyCompatibleDistributions() throws Exception {
|
||||
assumeTrue("only compatible distributions", distribution().packaging.compatible);
|
||||
assumeTrue("rpm or deb",
|
||||
distribution().packaging == Distribution.Packaging.DEB || distribution().packaging == Distribution.Packaging.RPM);
|
||||
sh = newShell();
|
||||
}
|
||||
|
||||
public void test11DebDependencies() {
|
||||
// TODO: rewrite this test to not use a real second distro to try and install
|
||||
assumeTrue(Platforms.isDPKG());
|
||||
|
||||
final Shell sh = new Shell();
|
||||
|
||||
final Shell.Result result = sh.run("dpkg -I " + getDistributionFile(distribution()));
|
||||
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^ Depends:.*bash.*").matcher(result.stdout).find());
|
||||
|
||||
String oppositePackageName = "elasticsearch";
|
||||
if (distribution().isDefault()) {
|
||||
oppositePackageName += "-oss";
|
||||
}
|
||||
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^ Conflicts: " + oppositePackageName + "$").matcher(result.stdout).find());
|
||||
}
|
||||
|
||||
public void test11RpmDependencies() {
|
||||
// TODO: rewrite this test to not use a real second distro to try and install
|
||||
assumeTrue(Platforms.isRPM());
|
||||
|
||||
final Shell sh = new Shell();
|
||||
|
||||
final Shell.Result deps = sh.run("rpm -qpR " + getDistributionFile(distribution()));
|
||||
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^/bin/bash\\s*$").matcher(deps.stdout).find());
|
||||
|
||||
final Shell.Result conflicts = sh.run("rpm -qp --conflicts " + getDistributionFile(distribution()));
|
||||
|
||||
String oppositePackageName = "elasticsearch";
|
||||
if (distribution().isDefault()) {
|
||||
oppositePackageName += "-oss";
|
||||
}
|
||||
|
||||
TestCase.assertTrue(Pattern.compile("(?m)^" + oppositePackageName + "\\s*$").matcher(conflicts.stdout).find());
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ package org.elasticsearch.packaging.test;
|
|||
import com.carrotsearch.randomizedtesting.annotations.TestCaseOrdering;
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomStrings;
|
||||
import org.apache.http.client.fluent.Request;
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
import org.elasticsearch.packaging.util.FileUtils;
|
||||
import org.elasticsearch.packaging.util.Shell;
|
||||
import org.elasticsearch.packaging.util.Shell.Result;
|
||||
|
@ -70,12 +71,14 @@ import static org.junit.Assume.assumeThat;
|
|||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
@TestCaseOrdering(TestCaseOrdering.AlphabeticOrder.class)
|
||||
public abstract class PackageTestCase extends PackagingTestCase {
|
||||
public class PackageTests extends PackagingTestCase {
|
||||
private Shell sh;
|
||||
|
||||
@Before
|
||||
public void onlyCompatibleDistributions() throws Exception {
|
||||
assumeTrue("only compatible distributions", distribution().packaging.compatible);
|
||||
assumeTrue("rpm or deb",
|
||||
distribution().packaging == Distribution.Packaging.DEB || distribution().packaging == Distribution.Packaging.RPM);
|
||||
sh = newShell();
|
||||
}
|
||||
|
|
@ -36,6 +36,8 @@ import org.junit.Rule;
|
|||
import org.junit.rules.TestName;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static org.elasticsearch.packaging.util.Cleanup.cleanEverything;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
|
@ -52,6 +54,11 @@ public abstract class PackagingTestCase extends Assert {
|
|||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private static Distribution distribution;
|
||||
static {
|
||||
distribution = new Distribution(Paths.get(System.getProperty("tests.distribution")));
|
||||
}
|
||||
|
||||
@Rule
|
||||
public final TestName testNameRule = new TestName();
|
||||
|
||||
|
@ -70,7 +77,9 @@ public abstract class PackagingTestCase extends Assert {
|
|||
}
|
||||
|
||||
/** The {@link Distribution} that should be tested in this case */
|
||||
protected abstract Distribution distribution();
|
||||
protected static Distribution distribution() {
|
||||
return distribution;
|
||||
}
|
||||
|
||||
protected Shell newShell() throws Exception {
|
||||
Shell sh = new Shell();
|
||||
|
|
|
@ -21,16 +21,13 @@ package org.elasticsearch.packaging.test;
|
|||
|
||||
import com.carrotsearch.randomizedtesting.annotations.TestCaseOrdering;
|
||||
import org.elasticsearch.packaging.util.Distribution;
|
||||
import org.elasticsearch.packaging.util.Installation;
|
||||
import org.elasticsearch.packaging.util.Shell;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.elasticsearch.packaging.util.Cleanup.cleanEverything;
|
||||
import static org.elasticsearch.packaging.util.FileUtils.append;
|
||||
import static org.elasticsearch.packaging.util.FileUtils.assertPathsDontExist;
|
||||
import static org.elasticsearch.packaging.util.Packages.SYSTEMD_SERVICE;
|
||||
|
@ -48,21 +45,13 @@ import static org.junit.Assume.assumeThat;
|
|||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
@TestCaseOrdering(TestCaseOrdering.AlphabeticOrder.class)
|
||||
public abstract class RpmPreservationTestCase extends PackagingTestCase {
|
||||
|
||||
private static Installation installation;
|
||||
|
||||
protected abstract Distribution distribution();
|
||||
|
||||
@BeforeClass
|
||||
public static void cleanup() throws Exception {
|
||||
installation = null;
|
||||
cleanEverything();
|
||||
}
|
||||
public class RpmPreservationTests extends PackagingTestCase {
|
||||
|
||||
@Before
|
||||
public void onlyCompatibleDistributions() {
|
||||
assumeTrue("only rpm platforms", isRPM());
|
||||
assumeTrue("rpm distributions", distribution().packaging == Distribution.Packaging.RPM);
|
||||
assumeTrue("only bundled jdk", distribution().hasJdk);
|
||||
assumeTrue("only compatible distributions", distribution().packaging.compatible);
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ import static org.elasticsearch.packaging.util.FileUtils.mv;
|
|||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
||||
public abstract class WindowsServiceTestCase extends PackagingTestCase {
|
||||
public class WindowsServiceTests extends PackagingTestCase {
|
||||
|
||||
private static final String DEFAULT_ID = "elasticsearch-service-x64";
|
||||
private static final String DEFAULT_DISPLAY_NAME = "Elasticsearch " + FileUtils.getCurrentVersion() + " (elasticsearch-service-x64)";
|
||||
|
@ -57,6 +57,7 @@ public abstract class WindowsServiceTestCase extends PackagingTestCase {
|
|||
@BeforeClass
|
||||
public static void ensureWindows() {
|
||||
assumeTrue(Platforms.WINDOWS);
|
||||
assumeTrue(distribution().hasJdk);
|
||||
}
|
||||
|
||||
@After
|
|
@ -19,6 +19,9 @@
|
|||
|
||||
package org.elasticsearch.packaging.util;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
@ -52,6 +55,8 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class Archives {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(Archives.class);
|
||||
|
||||
// in the future we'll run as a role user on Windows
|
||||
public static final String ARCHIVE_OWNER = Platforms.WINDOWS
|
||||
? "vagrant"
|
||||
|
@ -71,27 +76,27 @@ public class Archives {
|
|||
assertThat("distribution file must exist: " + distributionFile.toString(), Files.exists(distributionFile), is(true));
|
||||
assertThat("elasticsearch must not already be installed", lsGlob(baseInstallPath, "elasticsearch*"), empty());
|
||||
|
||||
logger.info("Installing file: " + distributionFile);
|
||||
final String installCommand;
|
||||
if (distribution.packaging == Distribution.Packaging.TAR) {
|
||||
|
||||
Platforms.onLinux(() -> sh.run("tar -C " + baseInstallPath + " -xzpf " + distributionFile));
|
||||
|
||||
if (Platforms.WINDOWS) {
|
||||
throw new RuntimeException("Distribution " + distribution + " is not supported on windows");
|
||||
throw new IllegalStateException("Distribution " + distribution + " is not supported on windows");
|
||||
}
|
||||
installCommand = "tar -C " + baseInstallPath + " -xzpf " + distributionFile;
|
||||
|
||||
} else if (distribution.packaging == Distribution.Packaging.ZIP) {
|
||||
|
||||
Platforms.onLinux(() -> sh.run("unzip " + distributionFile + " -d " + baseInstallPath));
|
||||
|
||||
Platforms.onWindows(() -> sh.run(
|
||||
if (Platforms.WINDOWS == false) {
|
||||
throw new IllegalStateException("Distribution " + distribution + " is not supported on linux");
|
||||
}
|
||||
installCommand =
|
||||
"Add-Type -AssemblyName 'System.IO.Compression.Filesystem'; " +
|
||||
"[IO.Compression.ZipFile]::ExtractToDirectory('" + distributionFile + "', '" + baseInstallPath + "')"
|
||||
));
|
||||
"[IO.Compression.ZipFile]::ExtractToDirectory('" + distributionFile + "', '" + baseInstallPath + "')";
|
||||
|
||||
} else {
|
||||
throw new RuntimeException("Distribution " + distribution + " is not a known archive type");
|
||||
}
|
||||
|
||||
sh.run(installCommand);
|
||||
assertThat("archive was extracted", Files.exists(extractedPath), is(true));
|
||||
|
||||
mv(extractedPath, fullInstallPath);
|
||||
|
|
|
@ -19,63 +19,26 @@
|
|||
|
||||
package org.elasticsearch.packaging.util;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Locale;
|
||||
|
||||
public enum Distribution {
|
||||
|
||||
OSS_LINUX(Packaging.TAR, Platform.LINUX, Flavor.OSS, true),
|
||||
OSS_WINDOWS(Packaging.ZIP, Platform.WINDOWS, Flavor.OSS, true),
|
||||
OSS_DARWIN(Packaging.TAR, Platform.DARWIN, Flavor.OSS, true),
|
||||
OSS_DEB(Packaging.DEB, Platform.LINUX, Flavor.OSS, true),
|
||||
OSS_RPM(Packaging.RPM, Platform.LINUX, Flavor.OSS, true),
|
||||
|
||||
DEFAULT_LINUX(Packaging.TAR, Platform.LINUX, Flavor.DEFAULT, true),
|
||||
DEFAULT_WINDOWS(Packaging.ZIP, Platform.WINDOWS, Flavor.DEFAULT, true),
|
||||
DEFAULT_DARWIN(Packaging.TAR, Platform.DARWIN, Flavor.DEFAULT, true),
|
||||
DEFAULT_DEB(Packaging.DEB, Platform.LINUX, Flavor.DEFAULT, true),
|
||||
DEFAULT_RPM(Packaging.RPM, Platform.LINUX, Flavor.DEFAULT, true),
|
||||
|
||||
OSS_NO_JDK_LINUX(Packaging.TAR, Platform.LINUX, Flavor.OSS, false),
|
||||
OSS_NO_JDK_WINDOWS(Packaging.ZIP, Platform.WINDOWS, Flavor.OSS, false),
|
||||
OSS_NO_JDK_DARWIN(Packaging.TAR, Platform.DARWIN, Flavor.OSS, false),
|
||||
OSS_NO_JDK_DEB(Packaging.DEB, Platform.LINUX, Flavor.OSS, false),
|
||||
OSS_NO_JDK_RPM(Packaging.RPM, Platform.LINUX, Flavor.OSS, false),
|
||||
|
||||
DEFAULT_NO_JDK_LINUX(Packaging.TAR, Platform.LINUX, Flavor.DEFAULT, false),
|
||||
DEFAULT_NO_JDK_WINDOWS(Packaging.ZIP, Platform.WINDOWS, Flavor.DEFAULT, false),
|
||||
DEFAULT_NO_JDK_DARWIN(Packaging.TAR, Platform.DARWIN, Flavor.DEFAULT, false),
|
||||
DEFAULT_NO_JDK_DEB(Packaging.DEB, Platform.LINUX, Flavor.DEFAULT, false),
|
||||
DEFAULT_NO_JDK_RPM(Packaging.RPM, Platform.LINUX, Flavor.DEFAULT, false);
|
||||
public class Distribution {
|
||||
|
||||
public final Path path;
|
||||
public final Packaging packaging;
|
||||
public final Platform platform;
|
||||
public final Flavor flavor;
|
||||
public final boolean hasJdk;
|
||||
|
||||
Distribution(Packaging packaging, Platform platform, Flavor flavor, boolean hasJdk) {
|
||||
this.packaging = packaging;
|
||||
this.platform = platform;
|
||||
this.flavor = flavor;
|
||||
this.hasJdk = hasJdk;
|
||||
}
|
||||
|
||||
public String filename(String version) {
|
||||
String classifier = "";
|
||||
if (version.startsWith("6.") == false) {
|
||||
|
||||
if (hasJdk == false) {
|
||||
classifier += "-no-jdk";
|
||||
}
|
||||
if (packaging == Packaging.DEB) {
|
||||
classifier += "-amd64";
|
||||
} else {
|
||||
if (packaging != Packaging.RPM) {
|
||||
classifier += "-" + platform.toString();
|
||||
}
|
||||
classifier += "-x86_64";
|
||||
}
|
||||
}
|
||||
return flavor.name + "-" + version + classifier + packaging.extension;
|
||||
public Distribution(Path path) {
|
||||
this.path = path;
|
||||
String filename = path.getFileName().toString();
|
||||
int lastDot = filename.lastIndexOf('.');
|
||||
String extension = filename.substring(lastDot + 1);
|
||||
this.packaging = Packaging.valueOf(extension.equals("gz") ? "TAR" : extension.toUpperCase(Locale.ROOT));
|
||||
this.platform = filename.contains("windows") ? Platform.WINDOWS : Platform.LINUX;
|
||||
this.flavor = filename.contains("oss") ? Flavor.OSS : Flavor.DEFAULT;
|
||||
this.hasJdk = filename.contains("no-jdk") == false;
|
||||
}
|
||||
|
||||
public boolean isDefault() {
|
||||
|
|
|
@ -42,6 +42,7 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.ZipException;
|
||||
|
||||
|
@ -221,20 +222,19 @@ public class FileUtils {
|
|||
return getTempDir().resolve("elasticsearch");
|
||||
}
|
||||
|
||||
private static final Pattern VERSION_REGEX = Pattern.compile("(\\d+\\.\\d+\\.\\d+(-SNAPSHOT)?)");
|
||||
public static String getCurrentVersion() {
|
||||
return slurp(getPackagingArchivesDir().resolve("version"));
|
||||
}
|
||||
|
||||
public static Path getPackagingArchivesDir() {
|
||||
return Paths.get(""); // tests are started in the packaging archives dir, ie the empty relative path
|
||||
// TODO: just load this once
|
||||
String distroFile = System.getProperty("tests.distribution");
|
||||
java.util.regex.Matcher matcher = VERSION_REGEX.matcher(distroFile);
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
throw new IllegalStateException("Could not find version in filename: " + distroFile);
|
||||
}
|
||||
|
||||
public static Path getDistributionFile(Distribution distribution) {
|
||||
return getDistributionFile(distribution, getCurrentVersion());
|
||||
}
|
||||
|
||||
public static Path getDistributionFile(Distribution distribution, String version) {
|
||||
return getPackagingArchivesDir().resolve(distribution.filename(version));
|
||||
return distribution.path;
|
||||
}
|
||||
|
||||
public static void assertPathsExist(Path... paths) {
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
package org.elasticsearch.packaging.util;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.elasticsearch.packaging.util.Shell.Result;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -38,7 +40,6 @@ import static org.elasticsearch.packaging.util.FileMatcher.p660;
|
|||
import static org.elasticsearch.packaging.util.FileMatcher.p750;
|
||||
import static org.elasticsearch.packaging.util.FileMatcher.p755;
|
||||
import static org.elasticsearch.packaging.util.FileUtils.getCurrentVersion;
|
||||
import static org.elasticsearch.packaging.util.FileUtils.getDistributionFile;
|
||||
import static org.elasticsearch.packaging.util.Platforms.isSysVInit;
|
||||
import static org.elasticsearch.packaging.util.Platforms.isSystemd;
|
||||
import static org.elasticsearch.packaging.util.ServerUtils.waitForElasticsearch;
|
||||
|
@ -51,6 +52,8 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
public class Packages {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(Packages.class);
|
||||
|
||||
public static final Path SYSVINIT_SCRIPT = Paths.get("/etc/init.d/elasticsearch");
|
||||
public static final Path SYSTEMD_SERVICE = Paths.get("/usr/lib/systemd/system/elasticsearch.service");
|
||||
|
||||
|
@ -81,6 +84,7 @@ public class Packages {
|
|||
final Shell sh = new Shell();
|
||||
final Result result;
|
||||
|
||||
logger.info("Package type: " + distribution.packaging);
|
||||
if (distribution.packaging == Distribution.Packaging.RPM) {
|
||||
result = sh.runIgnoreExitCode("rpm -qe " + distribution.flavor.name);
|
||||
} else {
|
||||
|
@ -91,18 +95,14 @@ public class Packages {
|
|||
}
|
||||
|
||||
public static Installation install(Distribution distribution) throws IOException {
|
||||
return install(distribution, getCurrentVersion());
|
||||
}
|
||||
|
||||
public static Installation install(Distribution distribution, String version) throws IOException {
|
||||
Shell sh = new Shell();
|
||||
String systemJavaHome = sh.run("echo $SYSTEM_JAVA_HOME").stdout.trim();
|
||||
if (distribution.hasJdk == false) {
|
||||
sh.getEnv().put("JAVA_HOME", systemJavaHome);
|
||||
}
|
||||
final Result result = runInstallCommand(distribution, version, sh);
|
||||
final Result result = runInstallCommand(distribution, sh);
|
||||
if (result.exitCode != 0) {
|
||||
throw new RuntimeException("Installing distribution " + distribution + " version " + version + " failed: " + result);
|
||||
throw new RuntimeException("Installing distribution " + distribution + " failed: " + result);
|
||||
}
|
||||
|
||||
Installation installation = Installation.ofPackage(distribution.packaging);
|
||||
|
@ -114,8 +114,8 @@ public class Packages {
|
|||
return installation;
|
||||
}
|
||||
|
||||
public static Result runInstallCommand(Distribution distribution, String version, Shell sh) {
|
||||
final Path distributionFile = getDistributionFile(distribution, version);
|
||||
public static Result runInstallCommand(Distribution distribution, Shell sh) {
|
||||
final Path distributionFile = distribution.path;
|
||||
|
||||
if (Platforms.isRPM()) {
|
||||
return sh.runIgnoreExitCode("rpm -i " + distributionFile);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import org.elasticsearch.gradle.test.GradleDistroTestTask
|
||||
|
||||
String boxId = project.properties.get('vagrant.windows-2012r2.id')
|
||||
if (boxId != null) {
|
||||
|
@ -5,7 +6,8 @@ if (boxId != null) {
|
|||
hostEnv 'VAGRANT_WINDOWS_2012R2_BOX', boxId
|
||||
}
|
||||
} else {
|
||||
tasks.named('distroTest').configure {
|
||||
// box id was not supplied, so disable the distro tests
|
||||
tasks.withType(GradleDistroTestTask).configureEach {
|
||||
onlyIf { false }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import org.elasticsearch.gradle.test.GradleDistroTestTask
|
||||
|
||||
String boxId = project.properties.get('vagrant.windows-2016.id')
|
||||
if (boxId != null) {
|
||||
|
@ -5,7 +6,8 @@ if (boxId != null) {
|
|||
hostEnv 'VAGRANT_WINDOWS_2016_BOX', boxId
|
||||
}
|
||||
} else {
|
||||
tasks.named('distroTest').configure {
|
||||
onlyIf { true }
|
||||
// box id was not supplied, so disable the distro tests
|
||||
tasks.withType(GradleDistroTestTask).configureEach {
|
||||
onlyIf { false }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue