Skip to content
Open
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 @@ -469,6 +469,11 @@ public void extraJarFile(File from) {
nodes.all(node -> node.extraJarFile(from));
}

@Override
public void removeJarFile(File from, String module) {
nodes.all(node -> node.removeJarFile(from, module));
}

@Override
public void user(Map<String, String> userSpec) {
nodes.all(node -> node.user(userSpec));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public class OpenSearchNode implements TestClusterConfiguration {
private final LazyPropertyList<CharSequence> jvmArgs = new LazyPropertyList<>("JVM arguments", this);
private final LazyPropertyMap<String, File> extraConfigFiles = new LazyPropertyMap<>("Extra config files", this, FileEntry::new);
private final LazyPropertyList<File> extraJarFiles = new LazyPropertyList<>("Extra jar files", this);
private final LazyPropertyMap<String, List<File>> removeJarFiles = new LazyPropertyMap<>("Jar files to remove", this);
private final List<Map<String, String>> credentials = new ArrayList<>();
final LinkedHashMap<String, String> defaultConfig = new LinkedHashMap<>();

Expand Down Expand Up @@ -661,6 +662,20 @@ private void copyExtraJars() {
throw new UncheckedIOException("Can't copy extra jar dependency " + from.getName() + " to " + destination, e);
}
});
if (removeJarFiles.isEmpty() == false) {
// TODO make this message more verbose
logToProcessStdout("Removing jar files from " + removeJarFiles.size() + "modules");
}
for (String module : removeJarFiles.keySet()) {
List<File> jarsToDelete = removeJarFiles.get(module);
for (File from : jarsToDelete) {
try {
Files.deleteIfExists(getDistroDir().resolve("modules/" + module + "/" + from.getName()));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
}

private void installModules() {
Expand Down Expand Up @@ -712,6 +727,14 @@ public void extraJarFile(File from) {
extraJarFiles.add(from);
}

@Override
public void removeJarFile(File from, String module) {
if (from.toString().endsWith(".jar") == false) {
throw new IllegalArgumentException("jar file to remove " + from.toString() + " doesn't appear to be a JAR");
}
removeJarFiles.computeIfAbsent(module, k -> new ArrayList<>()).add(from);
}

@Override
public void user(Map<String, String> userSpec) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ public interface TestClusterConfiguration {

void extraJarFile(File from);

void removeJarFile(File from, String module);

void user(Map<String, String> userSpec);

String getHttpSocketURI();
Expand Down
38 changes: 38 additions & 0 deletions qa/fips-compliance/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.standalone-rest-test'
apply plugin: 'opensearch.rest-test'
apply plugin: 'opensearch.rest-resources'

configurations {
bouncycastleFips
}

dependencies {
bouncycastleFips 'org.bouncycastle:bc-fips:2.0.0'
bouncycastleFips 'org.bouncycastle:bcutil-fips:2.0.3'
bouncycastleFips 'org.bouncycastle:bcpkix-fips:2.0.7'
bouncycastleFips 'org.bouncycastle:bctls-fips:2.0.19'
}

testClusters.integTest {
systemProperty 'org.bouncycastle.fips.approved_only', 'true'
// systemProperty 'crypto.standard', 'FIPS-140-3'
keystorePassword 'notarealpasswordphrase'

// TODO Remove BCFIPS jars from modules/reindex
configurations.bouncycastleFips.files.each { jarFile ->
extraJarFile jarFile
removeJarFile(jarFile, "reindex")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

/*
* 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.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

package org.opensearch.smoketest;

import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;

import org.opensearch.test.rest.yaml.ClientYamlTestCandidate;
import org.opensearch.test.rest.yaml.OpenSearchClientYamlSuiteTestCase;

public class SmokeTestPluginsClientYamlTestSuiteIT extends OpenSearchClientYamlSuiteTestCase {

public SmokeTestPluginsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}

@ParametersFactory
public static Iterable<Object[]> parameters() throws Exception {
return OpenSearchClientYamlSuiteTestCase.createParameters();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Integration tests for smoke testing plugins
#
"Correct Plugin Count":
- do:
cluster.state: {}

# Get cluster-manager node id
- set: { cluster_manager_node: cluster_manager }

- do:
nodes.info: {}

- length: { nodes.$cluster_manager.plugins: 0 }
Loading