projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better release note check
[osm/devops.git]
/
installers
/
charm
/
nbi
/
tests
/
test_pod_spec.py
diff --git
a/installers/charm/nbi/tests/test_pod_spec.py
b/installers/charm/nbi/tests/test_pod_spec.py
index
7be4591
..
360895f
100644
(file)
--- a/
installers/charm/nbi/tests/test_pod_spec.py
+++ b/
installers/charm/nbi/tests/test_pod_spec.py
@@
-20,7
+20,6
@@
# osm-charmers@lists.launchpad.net
##
# osm-charmers@lists.launchpad.net
##
-from pydantic import ValidationError
from typing import NoReturn
import unittest
from typing import NoReturn
import unittest
@@
-57,7
+56,7
@@
class TestPodSpec(unittest.TestCase):
relation_state = {
"message_host": "kafka",
"message_port": 9090,
relation_state = {
"message_host": "kafka",
"message_port": 9090,
- "database_uri": "mongo://mongo",
+ "database_uri": "mongo
db
://mongo",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
}
"prometheus_host": "prometheus",
"prometheus_port": 9082,
}
@@
-97,7
+96,7
@@
class TestPodSpec(unittest.TestCase):
relation_state = {
"message_host": "kafka",
"message_port": 9090,
relation_state = {
"message_host": "kafka",
"message_port": 9090,
- "database_uri": "mongo://mongo",
+ "database_uri": "mongo
db
://mongo",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
"keystone_host": "keystone",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
"keystone_host": "keystone",
@@
-159,7
+158,7
@@
class TestPodSpec(unittest.TestCase):
relation_state = {
"message_host": "kafka",
"message_port": 9090,
relation_state = {
"message_host": "kafka",
"message_port": 9090,
- "database_uri": "mongo://mongo",
+ "database_uri": "mongo
db
://mongo",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
"keystone_host": "keystone",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
"keystone_host": "keystone",
@@
-205,6
+204,7
@@
class TestPodSpec(unittest.TestCase):
"name": f"{app_name}-ingress",
"annotations": {
"nginx.ingress.kubernetes.io/proxy-body-size": f"{config['max_file_size']}",
"name": f"{app_name}-ingress",
"annotations": {
"nginx.ingress.kubernetes.io/proxy-body-size": f"{config['max_file_size']}",
+ "nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
"nginx.ingress.kubernetes.io/ssl-redirect": "false",
},
"spec": {
"nginx.ingress.kubernetes.io/ssl-redirect": "false",
},
"spec": {
@@
-249,6
+249,7
@@
class TestPodSpec(unittest.TestCase):
"name": f"{app_name}-ingress",
"annotations": {
"nginx.ingress.kubernetes.io/proxy-body-size": f"{config['max_file_size']}",
"name": f"{app_name}-ingress",
"annotations": {
"nginx.ingress.kubernetes.io/proxy-body-size": f"{config['max_file_size']}",
+ "nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
"nginx.ingress.kubernetes.io/ssl-redirect": "false",
"nginx.ingress.kubernetes.io/whitelist-source-range": config[
"ingress_whitelist_source_range"
"nginx.ingress.kubernetes.io/ssl-redirect": "false",
"nginx.ingress.kubernetes.io/whitelist-source-range": config[
"ingress_whitelist_source_range"
@@
-297,6
+298,7
@@
class TestPodSpec(unittest.TestCase):
"name": f"{app_name}-ingress",
"annotations": {
"nginx.ingress.kubernetes.io/proxy-body-size": f"{config['max_file_size']}",
"name": f"{app_name}-ingress",
"annotations": {
"nginx.ingress.kubernetes.io/proxy-body-size": f"{config['max_file_size']}",
+ "nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
},
"spec": {
"rules": [
},
"spec": {
"rules": [
@@
-342,6
+344,7
@@
class TestPodSpec(unittest.TestCase):
"name": f"{app_name}-ingress",
"annotations": {
"nginx.ingress.kubernetes.io/proxy-body-size": f"{config['max_file_size']}",
"name": f"{app_name}-ingress",
"annotations": {
"nginx.ingress.kubernetes.io/proxy-body-size": f"{config['max_file_size']}",
+ "nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
},
"spec": {
"rules": [
},
"spec": {
"rules": [
@@
-432,7
+435,7
@@
class TestPodSpec(unittest.TestCase):
relation_state = {
"message_host": "kafka",
"message_port": 9090,
relation_state = {
"message_host": "kafka",
"message_port": 9090,
- "database_uri": "mongo://mongo",
+ "database_uri": "mongo
db
://mongo",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
}
"prometheus_host": "prometheus",
"prometheus_port": 9082,
}
@@
-452,17
+455,15
@@
class TestPodSpec(unittest.TestCase):
relation_state = {
"message_host": "kafka",
"message_port": 9090,
relation_state = {
"message_host": "kafka",
"message_port": 9090,
- "database_uri": "mongo://mongo",
+ "database_uri": "mongo
db
://mongo",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
}
app_name = "nbi"
port = 9999
"prometheus_host": "prometheus",
"prometheus_port": 9082,
}
app_name = "nbi"
port = 9999
- with self.assertRaises(ValidationError) as exc:
- pod_spec.make_pod_spec(
- image_info, config, relation_state, app_name, port
- )
+ with self.assertRaises(ValueError):
+ pod_spec.make_pod_spec(image_info, config, relation_state, app_name, port)
def test_make_pod_spec_without_relation_state(self) -> NoReturn:
"""Testing make pod spec without relation_state."""
def test_make_pod_spec_without_relation_state(self) -> NoReturn:
"""Testing make pod spec without relation_state."""
@@
-478,10
+479,8
@@
class TestPodSpec(unittest.TestCase):
app_name = "nbi"
port = 9999
app_name = "nbi"
port = 9999
- with self.assertRaises(ValidationError) as exc:
- pod_spec.make_pod_spec(
- image_info, config, relation_state, app_name, port
- )
+ with self.assertRaises(ValueError):
+ pod_spec.make_pod_spec(image_info, config, relation_state, app_name, port)
def test_make_pod_spec(self) -> NoReturn:
"""Testing make pod spec."""
def test_make_pod_spec(self) -> NoReturn:
"""Testing make pod spec."""
@@
-496,7
+495,7
@@
class TestPodSpec(unittest.TestCase):
relation_state = {
"message_host": "kafka",
"message_port": 9090,
relation_state = {
"message_host": "kafka",
"message_port": 9090,
- "database_uri": "mongo://mongo",
+ "database_uri": "mongo
db
://mongo",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
}
"prometheus_host": "prometheus",
"prometheus_port": 9082,
}
@@
-562,7
+561,7
@@
class TestPodSpec(unittest.TestCase):
relation_state = {
"message_host": "kafka",
"message_port": 9090,
relation_state = {
"message_host": "kafka",
"message_port": 9090,
- "database_uri": "mongo://mongo",
+ "database_uri": "mongo
db
://mongo",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
"keystone_host": "keystone",
"prometheus_host": "prometheus",
"prometheus_port": 9082,
"keystone_host": "keystone",