holado 0.8.4__py3-none-any.whl → 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of holado might be problematic. Click here for more details.
- {holado-0.8.4.dist-info → holado-0.9.0.dist-info}/METADATA +1 -1
- {holado-0.8.4.dist-info → holado-0.9.0.dist-info}/RECORD +28 -13
- holado_core/common/resource/persisted_data_manager.py +10 -10
- holado_core/common/resource/resource_manager.py +34 -37
- holado_core/common/resource/table_data_manager.py +110 -0
- holado_core/common/tools/path_manager.py +30 -5
- holado_python/common/tools/datetime.py +7 -4
- holado_python/standard_library/ssl/resources/certificates/tcpbin.crt +16 -16
- holado_python/standard_library/ssl/resources/certificates/tcpbin.key +26 -26
- holado_report/__init__.py +1 -0
- holado_report/campaign/campaign_manager.py +189 -0
- holado_report/report/report_manager.py +2 -0
- holado_system/system/filesystem/file.py +5 -2
- holado_test/test_server/server/Dockerfile +70 -0
- holado_test/test_server/server/core/server_context.py +42 -0
- holado_test/test_server/server/core/server_manager.py +54 -0
- holado_test/test_server/server/requirements.txt +2 -0
- holado_test/test_server/server/rest/README +2 -0
- holado_test/test_server/server/rest/api/__init__.py +23 -0
- holado_test/test_server/server/rest/api/campaign/__init__.py +28 -0
- holado_test/test_server/server/rest/api/campaign/scenario.py +33 -0
- holado_test/test_server/server/rest/initialize_holado.py +72 -0
- holado_test/test_server/server/rest/logging.conf +50 -0
- holado_test/test_server/server/rest/openapi.yaml +46 -0
- holado_test/test_server/server/rest/run.py +40 -0
- holado_test/test_server/server/run_test_server_in_docker.sh +101 -0
- {holado-0.8.4.dist-info → holado-0.9.0.dist-info}/WHEEL +0 -0
- {holado-0.8.4.dist-info → holado-0.9.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#################################################
|
|
2
|
+
# HolAdo (Holistic Automation do)
|
|
3
|
+
#
|
|
4
|
+
# (C) Copyright 2021-2025 by Eric Klumpp
|
|
5
|
+
#
|
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
7
|
+
#
|
|
8
|
+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
+
|
|
10
|
+
# The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
|
|
11
|
+
#################################################
|
|
12
|
+
|
|
13
|
+
import connexion
|
|
14
|
+
from connexion.resolver import MethodViewResolver
|
|
15
|
+
import os
|
|
16
|
+
import logging
|
|
17
|
+
|
|
18
|
+
here = os.path.abspath(os.path.dirname(__file__))
|
|
19
|
+
|
|
20
|
+
# For debug with HolAdo sources, insert HolAdo source paths
|
|
21
|
+
from initialize_holado import insert_holado_source_paths # @UnresolvedImport
|
|
22
|
+
insert_holado_source_paths(with_test_behave=False)
|
|
23
|
+
|
|
24
|
+
# Initialize HolAdo
|
|
25
|
+
import holado
|
|
26
|
+
from holado_test.test_server.server.core.server_context import TestServerSessionContext
|
|
27
|
+
holado.initialize(TSessionContext=TestServerSessionContext,
|
|
28
|
+
logging_config_file_path=os.path.join(here, 'logging.conf'), log_level=logging.INFO,
|
|
29
|
+
log_on_console=True, log_in_file=False,
|
|
30
|
+
garbage_collector_periodicity=None)
|
|
31
|
+
|
|
32
|
+
# Update stored campaigns
|
|
33
|
+
from holado.common.context.session_context import SessionContext
|
|
34
|
+
SessionContext.instance().server_manager.campaign_manager.update_stored_campaigns()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
app = connexion.FlaskApp(__name__, pythonic_params=True)
|
|
38
|
+
app.add_api('openapi.yaml',
|
|
39
|
+
resolver=MethodViewResolver('api'), resolver_error=501,
|
|
40
|
+
pythonic_params=True)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Script to launch Test Server as a docker image.
|
|
4
|
+
#
|
|
5
|
+
# Test Server exposes a REST API for some docker commands.
|
|
6
|
+
# It is accessible on localhost, and also on a docker network if HOLADO_NETWORK is defined.
|
|
7
|
+
# On all networks, API is accessible on same port (HOLADO_TEST_SERVER_PORT or 8001).
|
|
8
|
+
#
|
|
9
|
+
# REST API specification is in file rest/openapi.yaml.
|
|
10
|
+
#
|
|
11
|
+
# REQUIREMENTS:
|
|
12
|
+
# Have access to any HolAdo registry.
|
|
13
|
+
#
|
|
14
|
+
# Optionally, define in .profile the following variables
|
|
15
|
+
# - HOLADO_TEST_SERVER_NAME: name of the container
|
|
16
|
+
# - HOLADO_TEST_SERVER_PORT: REST API port to use (default: 8001)
|
|
17
|
+
# - HOLADO_IMAGE_REGISTRY: docker image registry to use (default: holado/test_server)
|
|
18
|
+
# - HOLADO_IMAGE_TAG: docker image tag to use (default: latest)
|
|
19
|
+
# - HOLADO_OUTPUT_BASEDIR: absolute path to base output directory (default: [HOME]/.holado/output)
|
|
20
|
+
# - HOLADO_USE_LOCALHOST: force the container network to 'host'.
|
|
21
|
+
# - HOLADO_NETWORK: specify on which network the docker is run.
|
|
22
|
+
#
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
WORK_DIR="$(pwd)"
|
|
26
|
+
|
|
27
|
+
if [[ -z "$HOLADO_IMAGE_REGISTRY" ]]; then
|
|
28
|
+
HOLADO_IMAGE_REGISTRY=holado/test_server
|
|
29
|
+
fi
|
|
30
|
+
if [[ -z "$HOLADO_IMAGE_TAG" ]]; then
|
|
31
|
+
HOLADO_IMAGE_TAG=latest
|
|
32
|
+
fi
|
|
33
|
+
SERVER_IMAGE=${HOLADO_IMAGE_REGISTRY}:${HOLADO_IMAGE_TAG}
|
|
34
|
+
|
|
35
|
+
# Update docker image
|
|
36
|
+
echo "Updating docker image ${SERVER_IMAGE}..."
|
|
37
|
+
docker pull ${SERVER_IMAGE}
|
|
38
|
+
|
|
39
|
+
# Define test output directory
|
|
40
|
+
if [[ ! -z "$HOLADO_OUTPUT_BASEDIR" ]]; then
|
|
41
|
+
OUTPUT_DIR=${HOLADO_OUTPUT_BASEDIR}
|
|
42
|
+
else
|
|
43
|
+
OUTPUT_DIR=${HOME}/.holado/output
|
|
44
|
+
fi
|
|
45
|
+
echo "Output directory: $OUTPUT_DIR"
|
|
46
|
+
|
|
47
|
+
# Define test resources directory
|
|
48
|
+
if [[ ! -z "$HOLADO_LOCAL_RESOURCES_BASEDIR" ]]; then
|
|
49
|
+
RESOURCES_DIR=${HOLADO_LOCAL_RESOURCES_BASEDIR}
|
|
50
|
+
else
|
|
51
|
+
RESOURCES_DIR=${HOME}/.holado/resources
|
|
52
|
+
fi
|
|
53
|
+
echo "Resources directory: $RESOURCES_DIR"
|
|
54
|
+
|
|
55
|
+
# Make dirs
|
|
56
|
+
if [ ! -d ${OUTPUT_DIR} ]; then
|
|
57
|
+
echo "Create output directory: ${OUTPUT_DIR}"
|
|
58
|
+
mkdir -p ${OUTPUT_DIR}
|
|
59
|
+
fi
|
|
60
|
+
if [ ! -d ${RESOURCES_DIR} ]; then
|
|
61
|
+
echo "Create resources directory: ${RESOURCES_DIR}"
|
|
62
|
+
mkdir -p ${RESOURCES_DIR}
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# Define container network
|
|
66
|
+
if [ "$HOLADO_USE_LOCALHOST" = True ]; then
|
|
67
|
+
NETWORK_DEF_COMMAND="--network=host"
|
|
68
|
+
else
|
|
69
|
+
if [[ ! -z "$HOLADO_NETWORK" ]]; then
|
|
70
|
+
NETWORK_DEF_COMMAND="--network $HOLADO_NETWORK"
|
|
71
|
+
else
|
|
72
|
+
NETWORK_DEF_COMMAND=""
|
|
73
|
+
fi
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
# Define port to use
|
|
77
|
+
if [[ -z "$HOLADO_TEST_SERVER_PORT" ]]; then
|
|
78
|
+
HOLADO_TEST_SERVER_PORT=8001
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# Docker run
|
|
83
|
+
if [[ -z "$HOLADO_TEST_SERVER_NAME" ]]; then
|
|
84
|
+
HOLADO_TEST_SERVER_NAME=holado_test_server
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
echo
|
|
88
|
+
echo "Running Test Server (docker name: ${HOLADO_TEST_SERVER_NAME})..."
|
|
89
|
+
echo " port: ${HOLADO_TEST_SERVER_PORT}"
|
|
90
|
+
#echo " NETWORK_DEF_COMMAND=${NETWORK_DEF_COMMAND}"
|
|
91
|
+
echo
|
|
92
|
+
docker run --rm --user root --name ${HOLADO_TEST_SERVER_NAME} \
|
|
93
|
+
-v "${OUTPUT_DIR}":/output \
|
|
94
|
+
-v "${RESOURCES_DIR}":/resources \
|
|
95
|
+
-e HOLADO_OUTPUT_BASEDIR=/output \
|
|
96
|
+
-e HOLADO_LOCAL_RESOURCES_BASEDIR=/resources \
|
|
97
|
+
-e HOLADO_TEST_SERVER_PORT=${HOLADO_TEST_SERVER_PORT} \
|
|
98
|
+
${NETWORK_DEF_COMMAND} \
|
|
99
|
+
-p ${HOLADO_TEST_SERVER_PORT}:${HOLADO_TEST_SERVER_PORT} \
|
|
100
|
+
${SERVER_IMAGE}
|
|
101
|
+
|
|
File without changes
|
|
File without changes
|