blob: 2e0f83309e5f45156031eaab40e9d60251c376c3 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF 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.
#
%system kubectl -n nuvolaris delete all --all
%system kubectl -n nuvolaris delete pvc --all
import nuvolaris.config as cfg
import nuvolaris.kafka as kafka
import nuvolaris.kube as kube
import nuvolaris.testutil as tu
import nuvolaris.zookeeper as zookeeper
# test
assert(cfg.configure(tu.load_sample_config(name="whisk-full")))
assert(cfg.detect_storage()["nuvolaris.storageclass"])
assert(zookeeper.create())
pod_name = zookeeper.get_zookeeper_pod_name()
assert(pod_name)
zookeeper_version = kube.kubectl("get", f"pods/{pod_name}", jsonpath="{.spec.containers[0].image}")
assert(zookeeper_version[0] == "ghcr.io/nuvolaris/zookeeper:3.4.14")
# check the url is stored into the configuration
assert(cfg.get("nuvolaris.zookeeper.url") == "zookeeper-0.zookeeper:2181")
assert(kafka.create())
pod_name = kafka.get_kafka_pod_name()
assert(pod_name)
# check the url is stored into the configuration
assert(cfg.get("nuvolaris.kafka.url") == "kafka:9092")
assert(kafka.delete())
assert(zookeeper.delete())