Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
sophon-zt committed Feb 28, 2025
1 parent 6ae59a4 commit 2df2d44
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions addons/pulsar/scripts-ut-spec/init_broker_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Describe "Pulsar Init Broker Bash Script Tests"

Describe "check_env_variables()"
It "checks if required environment variables are set"
export zookeeperServers="localhost:2181"
export ZOOKEEPER_SERVERS="localhost:2181"
export POD_NAME="broker-0"
export clusterName="my-cluster"
export webServiceUrl="http://localhost:8080"
Expand All @@ -32,7 +32,7 @@ Describe "Pulsar Init Broker Bash Script Tests"
unset zookeeperServers

When run check_env_variables
The output should include "Error: zookeeperServers environment variable is not set, Please set the zookeeperServers environment variable and try again."
The output should include "Error: ZOOKEEPER_SERVERS environment variable is not set, Please set the ZOOKEEPER_SERVERS environment variable and try again."
The status should be failure
End
End
Expand Down
4 changes: 2 additions & 2 deletions addons/pulsar/scripts-ut-spec/init_proxy_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Describe "Pulsar Init Proxy Bash Script Tests"

Describe "main()"
It "waits for Zookeeper when metadataStoreUrl is provided"
export metadataStoreUrl="zookeeper.example.com:2181"
export ZOOKEEPER_SERVERS="zookeeper.example.com:2181"

wait_for_zookeeper() {
echo "wait_for_zookeeper called with $1"
Expand All @@ -43,7 +43,7 @@ Describe "Pulsar Init Proxy Bash Script Tests"
End

It "skips Zookeeper readiness check when metadataStoreUrl is not provided"
unset metadataStoreUrl
unset ZOOKEEPER_SERVERS

wait_for_zookeeper() {
echo "wait_for_zookeeper called"
Expand Down
4 changes: 2 additions & 2 deletions addons/pulsar/scripts-ut-spec/start_bookies_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ Describe "Pulsar Start Bookies Bash Script Tests"
zkURL="zookeeper.example.com"

When run handle_empty_directories
The stderr should include "Error: BOOKKEEPER_POD_FQDN_LIST or CURRENT_POD_NAME or zkServers is empty. Exiting."
The stderr should include "Error: BOOKKEEPER_POD_FQDN_LIST or CURRENT_POD_NAME or ZOOKEEPER_SERVERS is empty. Exiting."
The stdout should include "journalRes and ledgerRes directory is empty, check whether the remote cookies is empty either"
The status should be failure
End

It "removes redundant bookieID if necessary"
BOOKKEEPER_POD_FQDN_LIST="pod1,pod2"
CURRENT_POD_NAME="pod1"
zkServers="pod1.svc.cluster.local"
ZOOKEEPER_SERVERS="pod1.svc.cluster.local"

get_target_pod_fqdn_from_pod_fqdn_vars() {
echo "pod1.example.com"
Expand Down
2 changes: 1 addition & 1 deletion addons/pulsar/scripts/init-bookies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ load_env_file() {

init_bookies() {
if [[ -z "$ZOOKEEPER_SERVERS" ]]; then
echo "Error: zkServers environment variable is not set, Please set the zkServers environment variable and try again."
echo "Error: ZOOKEEPER_SERVERS environment variable is not set, Please set the ZOOKEEPER_SERVERS environment variable and try again."
exit 1
fi

Expand Down

0 comments on commit 2df2d44

Please sign in to comment.