-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #389 from jfdenise/cloud-4173-cont
Fix for CLOUD-4173 continuing
- Loading branch information
Showing
4 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
jboss/container/wildfly/launch/os/node-name/test/node-name.bats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bats | ||
|
||
# fake JBOSS_HOME | ||
export JBOSS_HOME=$BATS_TMPDIR/jboss_home | ||
rm -rf $JBOSS_HOME 2>/dev/null | ||
mkdir -p $JBOSS_HOME/bin/launch | ||
|
||
# copy scripts we are going to use | ||
cp $BATS_TEST_DIRNAME/../added/launch/openshift-node-name.sh $JBOSS_HOME/bin/launch | ||
|
||
|
||
# source the scripts needed | ||
source $JBOSS_HOME/bin/launch/openshift-node-name.sh | ||
|
||
|
||
@test "JBoss Node name set to a value smaller than 23" { | ||
JBOSS_NODE_NAME=foo | ||
init_node_name | ||
[ "${JBOSS_NODE_NAME}" = "foo" ] | ||
[ "${JBOSS_TX_NODE_ID}" = "foo" ] | ||
} | ||
|
||
@test "JBOSS_NODE_NAME set" { | ||
JBOSS_NODE_NAME=abcdefghijklmnopqrstuvwxyz123 | ||
init_node_name | ||
echo $JBOSS_NODE_NAME | ||
|
||
# Verify that jboss.node.name is untouched | ||
[ "${JBOSS_NODE_NAME}" = "abcdefghijklmnopqrstuvwxyz123" ] | ||
# Verify that jboss.tx.node.id is truncated to last 23 characters | ||
[ "${JBOSS_TX_NODE_ID}" = "ghijklmnopqrstuvwxyz123" ] | ||
} | ||
|
||
@test "Node name set" { | ||
NODE_NAME=abcdefghijklmnopqrstuvwxyz | ||
init_node_name | ||
|
||
# Verify that jboss.node.name is untouched | ||
[ "${JBOSS_NODE_NAME}" = "abcdefghijklmnopqrstuvwxyz" ] | ||
# Verify that jboss.tx.node.id is truncated to last 23 characters | ||
[ "${JBOSS_TX_NODE_ID}" = "defghijklmnopqrstuvwxyz" ] | ||
} | ||
|
||
@test "Node name set to value smaller than 23" { | ||
NODE_NAME=abcdef | ||
init_node_name | ||
|
||
# Verify that jboss.node.name is untouched | ||
[ "${JBOSS_NODE_NAME}" = "abcdef" ] | ||
# Verify that jboss.tx.node.id is untouched | ||
[ "${JBOSS_TX_NODE_ID}" = "abcdef" ] | ||
} | ||
|
||
@test "Host name set" { | ||
HOSTNAME=abcdefghijklmnopqrstuvwxyz123 | ||
init_node_name | ||
echo $JBOSS_NODE_NAME | ||
|
||
# Verify that jboss.node.name is untouched | ||
[ "${JBOSS_NODE_NAME}" = "abcdefghijklmnopqrstuvwxyz123" ] | ||
# Verify that jboss.tx.node.id is truncated to last 23 characters | ||
[ "${JBOSS_TX_NODE_ID}" = "ghijklmnopqrstuvwxyz123" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters