Skip to content

Commit

Permalink
packages updates. Fixes #80
Browse files Browse the repository at this point in the history
  • Loading branch information
rigazilla authored and karesti committed Apr 15, 2024
1 parent ef13447 commit 2730d39
Show file tree
Hide file tree
Showing 10 changed files with 834 additions and 576 deletions.
1,292 changes: 777 additions & 515 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@
"buffer-xor": "^2.0.2",
"log4js": "^6.4.6",
"protobufjs": "^7.0.0",
"underscore": "^1.13.3"
"underscore": "^1.13.3",
"urllib": "^3.23.0"
},
"devDependencies": {
"eslint": "^8.26.0",
"growl": "^1.10.5",
"jasmine-node": "^3.0.0",
"jsdoc": "^3.6.10",
"node-fetch": "^2.6.8"
"jasmine-node": "^1.16.0",
"long": "^5.2.3"
}
}
17 changes: 16 additions & 1 deletion run-servers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ else
fi

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SERVER_VERSION="${SERVER_VERSION:-"13.0.14.Final"}"
SERVER_VERSION="${SERVER_VERSION:-"14.0.27.Final"}"
SERVER_HOME=${SCRIPT_DIR}/server/original-server
SERVER_ZIP=${SCRIPT_DIR}/server/${SERVER_VERSION}.zip
CLUSTER_SIZE_MAIN="$SERVER_HOME/bin/cli.sh -c http://admin:pass@localhost:11322 -f batch "
Expand All @@ -30,6 +30,7 @@ EOF
MEMBERS_MAIN=''
while [ "$MEMBERS_MAIN" != '3' ];
do
echo $CLUSTER_SIZE_MAIN
MEMBERS_MAIN=$($CLUSTER_SIZE_MAIN | grep cluster_size | cut -d':' -f2 | sed 's/.$//' | sed -e 's/^[[:space:]]*//')
echo "Waiting for clusters to form (main: $MEMBERS_MAIN)"
sleep 20
Expand Down Expand Up @@ -78,6 +79,18 @@ function prepareServerDir()

echo "Infinispan configuration file ${confPath} copied to server ${dirName}."

#Installing nashorn engine before server startup
# If java > 15
if [ $(javap -verbose java.lang.String | grep "major version" | cut -d " " -f5) -ge 60 ]; then
mkdir -p ${SERVER_TMP}/${dirName}/lib
${SERVER_TMP}/bin/cli.sh install org.openjdk.nashorn:nashorn-core:15.4 --server-root=${dirName}
${SERVER_TMP}/bin/cli.sh install org.ow2.asm:asm:9.4 --server-root=${dirName}
${SERVER_TMP}/bin/cli.sh install org.ow2.asm:asm-commons:9.4 --server-root=${dirName}
${SERVER_TMP}/bin/cli.sh install org.ow2.asm:asm-tree:9.4 --server-root=${dirName}
${SERVER_TMP}/bin/cli.sh install org.ow2.asm:asm-util:9.4 --server-root=${dirName}
echo Nashorn script engine installed for ${dirName}
fi

if [[ ${isSsl} = "true" && ${IS_SSL_PROCESSED} = 0 ]]; then
./make-ssl.sh
echo "Generate TLS/SSL certificates"
Expand Down Expand Up @@ -112,6 +125,8 @@ function startServer()
portStr="-p ${port}"
fi

echo 'Cleaning data dir in '$SERVER_TMP''
rm -rf $SERVER_TMP/data/*
echo 'Run server '$nodeName' in '$SERVER_TMP''

if [[ ${isCi} = "--ci" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions spec/configs/clean/infinispan.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:server="urn:infinispan:server:12.0">

<cache-container>
<transport cluster="${infinispan.cluster.name}" stack="${infinispan.cluster.stack:tcp}"/>
<transport cluster="${infinispan.cluster.name:cluster}" stack="${infinispan.cluster.stack:tcp}"/>
</cache-container>

<server xmlns="urn:infinispan:server:12.0">
Expand All @@ -28,7 +28,7 @@
<!-- server-identities>
<ssl>
<keystore path="application.keystore" relative-to="infinispan.server.config.path"
keystore-password="password" alias="server" key-password="password"
password="password" alias="server" key-password="password"
generate-self-signed-certificate-host="localhost"/>
</ssl>
</server-identities-->
Expand All @@ -52,4 +52,4 @@
<!-- memcached-connector socket-binding="memcached" / -->
</endpoints>
</server>
</infinispan>
</infinispan>
4 changes: 2 additions & 2 deletions spec/configs/infinispan-clustered.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- <security>-->
<!-- <authorization/>-->
<!-- </security>-->
<transport cluster="${infinispan.cluster.name}" stack="${infinispan.cluster.stack:tcp}" node-name="${infinispan.node.name:}"/>
<transport cluster="${infinispan.cluster.name:cluster}" stack="${infinispan.cluster.stack:tcp}" node-name="${infinispan.node.name:}"/>
<!--<global-state/>-->
<metrics accurate-size="true"/>
<distributed-cache name="default" segments="20" remote-timeout="30000">
Expand All @@ -36,7 +36,7 @@
<!-- server-identities>
<ssl>
<keystore path="application.keystore" relative-to="infinispan.server.config.path"
keystore-password="password" alias="server" key-password="password"
password="password" alias="server" key-password="password"
generate-self-signed-certificate-host="localhost"/>
</ssl>
</server-identities-->
Expand Down
12 changes: 6 additions & 6 deletions spec/configs/infinispan-ssl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<security-realm name="default">
<server-identities>
<ssl>
<keystore path="server.p12" keystore-password="secret" alias="server"/>
<keystore path="server.p12" password="secret" alias="server"/>
</ssl>
</server-identities>
<properties-realm groups-attribute="Roles">
Expand All @@ -57,33 +57,33 @@
<security-realm name="client-cert">
<server-identities>
<ssl>
<keystore path="server.p12" keystore-password="secret" alias="server"/>
<keystore path="server.p12" password="secret" alias="server"/>
</ssl>
</server-identities>
<properties-realm groups-attribute="Roles">
<user-properties path="users.properties"/>
<group-properties path="groups.properties"/>
</properties-realm>
<!--truststore-realm path="client.p12" keystore-password="secret"/-->
<!--truststore-realm path="client.p12" password="secret"/-->
</security-realm>
<security-realm name="Trust1Realm">
<server-identities>
<ssl>
<keystore path="trust1.p12" keystore-password="secret"/>
<keystore path="trust1.p12" password="secret"/>
</ssl>
</server-identities>
</security-realm>
<security-realm name="Trust2Realm">
<server-identities>
<ssl>
<keystore path="trust2.p12" keystore-password="secret"/>
<keystore path="trust2.p12" password="secret"/>
</ssl>
</server-identities>
</security-realm>
<security-realm name="UntrustRealm">
<server-identities>
<ssl>
<keystore path="untrust.p12" keystore-password="secret"/>
<keystore path="untrust.p12" password="secret"/>
</ssl>
</server-identities>
</security-realm>
Expand Down
2 changes: 1 addition & 1 deletion spec/configs/infinispan-xsite-EARTH.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<!-- server-identities>
<ssl>
<keystore path="application.keystore" relative-to="infinispan.server.config.path"
keystore-password="password" alias="server" key-password="password"
password="password" alias="server" key-password="password"
generate-self-signed-certificate-host="localhost"/>
</ssl>
</server-identities-->
Expand Down
2 changes: 1 addition & 1 deletion spec/configs/infinispan-xsite-MOON.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<!-- server-identities>
<ssl>
<keystore path="application.keystore" relative-to="infinispan.server.config.path"
keystore-password="password" alias="server" key-password="password"
password="password" alias="server" key-password="password"
generate-self-signed-certificate-host="localhost"/>
</ssl>
</server-identities-->
Expand Down
2 changes: 1 addition & 1 deletion spec/configs/infinispan.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<!-- server-identities>
<ssl>
<keystore path="application.keystore" relative-to="infinispan.server.config.path"
keystore-password="password" alias="server" key-password="password"
password="password" alias="server" key-password="password"
generate-self-signed-certificate-host="localhost"/>
</ssl>
</server-identities-->
Expand Down
64 changes: 23 additions & 41 deletions spec/utils/testing.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable require-jsdoc */
// Commons functions

var _ = require('underscore');

var log4js = require('log4js');

var readFile = require('fs').readFile;
var httpRequest = require('node-fetch');
var httpRequest = require('urllib');
var util = require('util');

var f = require('../../lib/functional');
Expand Down Expand Up @@ -719,55 +720,36 @@ function getClusterMembers(port) {

return invokeDmrHttpGet('GET', opUrl, port)
.then(function(response) {
logger.debugf("Server '%s' replied with cluster members: %s", port, response.cluster_size);
logger.debugf('Server %s replied with cluster members: %s', port, response.cluster_size);
var members = response.cluster_size;
logger.debugf("Members are: %s", members);
logger.debugf('Members are: %s', members);
return members;
});
}
};
}

function invokeDmrHttp(op, port) {
return new Promise(function(fulfil, reject) {
httpRequest('http://localhost:' + port + '/rest/v2',{
method: 'POST',
headers: {
'Content-Type' : 'application/json',
'Authorization': `Basic ${Buffer.from('admin:pass', 'utf-8').toString('base64')}`
},
body: JSON.stringify(op)
}, function(error, response, body) {
if (!error && response.statusCode == 200) {
fulfil(JSON.parse(body));
} else {
reject(util.format('Error (%s), body (%s), response(%s)',
error, body, JSON.stringify(response)));
}
});
});
return httpRequest.request(`http://localhost:${port}/rest/v2`,
{method:'POST',
digestAuth: 'admin:pass',
headers:{
'Content-Type': 'application/json',
'body': op
}}).then(res => res.statusCode==200 ? JSON.parse(res.data) : {},
error => (util.format('Error (%s)', error)));
}

function invokeDmrHttpGet(method, opUrl, port) {
return new Promise(function(fulfil, reject) {
httpRequest('http://localhost:' + port + '/rest/v2' + opUrl, {
method: method,
headers: {
'Content-Type' : 'application/json',
'Authorization': `Basic ${Buffer.from('admin:pass', 'utf-8').toString('base64')}`
}
}, function(error, response, body) {
if (!error && response.statusCode >= 200 && response.statusCode <= 204) {
var resp = "";
if (body) {
resp = JSON.parse(body);
}
fulfil(resp);
} else {
reject(util.format('Error (%s), body (%s), response(%s)',
error, body, JSON.stringify(response)));
}
});
});

logger.debugf(`URL http://localhost:${port}/rest/v2${opUrl}`);
return httpRequest.request(`http://localhost:${port}/rest/v2${opUrl}`, {
method: method,
digestAuth: 'admin:pass',
headers: {
'Content-Type' : 'application/json'
}
}).then( res => res.statusCode==200 ? JSON.parse(res.data) : {},
error => (util.format('Error (%s)', error)));
}

function readFileAsync(path) {
Expand Down

0 comments on commit 2730d39

Please sign in to comment.