"python -c 'import sys, os.path, subprocess; [subprocess.check_call((\"python2\", \"./update-hash\", buildout_hash)) for buildout_hash in { os.path.join(os.path.dirname(staged), \"buildout.hash.cfg\") for staged in sys.argv[1:]} if os.path.exists(buildout_hash)]'",
"python -c 'import sys, os.path, subprocess; [subprocess.check_call((\"git\", \"add\", buildout_hash)) for buildout_hash in { os.path.join(os.path.dirname(staged), \"buildout.hash.cfg\") for staged in sys.argv[1:]} if os.path.exists(buildout_hash)]'"
"description":"The list shall be list of direct URLs to images, followed by hash (#), then by image MD5SUM. Each image shall appear on newline, like: \"https://example.com/image.iso#06226c7fac5bacfa385872a19bb99684<newline>https://example.com/another-image.iso#31b40d58b18e038498ddb46caea1361c\". They will be provided in KVM image list according to the order on the list. After updating the list, the instance has to be restarted to refresh it. Amount of images is limited to 4, and one image can be maximum 5G. Image will be downloaded and checked against its MD5SUM 4 times, then it will be considered as impossible to download with given MD5SUM. Each image has to be downloaded in time shorter than 4 hours, so in case of very slow images to access, it can take up to 16 hours to download all of them. Note: The instance has to be restarted in order to update the list of available images in the VM.",
"type":"string",
"textarea":"true"
}
},
"type":"object"
...
...
@@ -231,9 +237,8 @@
},
"ram-max-size":{
"title":"Maximum RAM size, in MB",
"description":"Define the maximum size of the memory. The size is in MB and should be a multiple of 512.",
"description":"Define the maximum size of the memory. The size is in MB and should be a multiple of 512. Defaults to ram-size + 512",
"type":"integer",
"default":51200,
"minimum":1024,
"multipleOf":512
},
...
...
@@ -318,9 +323,8 @@
},
"cpu-max-count":{
"title":"Maximum CPU amount",
"description":"Specifies the maximum number of CPUs.",
"description":"Specifies the maximum number of CPUs. Defaults to cpu-count + 1",
"description":"The list shall be list of direct URLs to images, followed by hash (#), then by image MD5SUM. Each image shall appear on newline, like: \"https://example.com/image.iso#06226c7fac5bacfa385872a19bb99684<newline>https://example.com/another-image.iso#31b40d58b18e038498ddb46caea1361c\". They will be provided in KVM image list according to the order on the list. After updating the list, the instance has to be restarted to refresh it. Amount of images is limited to 4, and one image can be maximum 5G. Image will be downloaded and checked against its MD5SUM 4 times, then it will be considered as impossible to download with given MD5SUM. Each image has to be downloaded in time shorter than 4 hours, so in case of very slow images to access, it can take up to 16 hours to download all of them. Note: The instance has to be restarted in order to update the list of available images in the VM.",
# It's very hard to put the username and password correctly, after schema://
# and before the host, as it's not the way how one can use monitor provided
# information, so just show the information in the URL
config-url = ${monitor-base:base-url}/private/image-url-list/${:filename} with username ${monitor-publish-parameters:monitor-user} and password ${monitor-publish-parameters:monitor-password}
[image-url-list-source-config]
# generates configuration of the image from the user parameter
# special "magic" is used, to properly support multiline image-url-list
# but in the same time correctly generate the configuration file
recipe = slapos.recipe.template:jinja2
template = inline:
{#- Do special trick to support image-url-list being None, if key is present with value "" #}
{%- raw %}
{{ slap_parameter.get('image-url-list') or '' }}
{% endraw -%}
context =
section slap_parameter slap-parameter
rendered = ${directory:etc}/image-url-list.conf
[image-url-list-processed-config]
# compares if the current configuration has been used by
# the image-url-list-download, if not, exposes it as not empty file with
# information
recipe = slapos.recipe.build
install =
import os
import hashlib
if not os.path.exists(location):
os.mkdir(location)
with open('${:state-file}', 'w') as state_handler:
try:
with open('${:config-file}', 'rb') as config_handler, open('${:processed-md5sum}') as processed_handler:
~/srv/runner/instance/slappart0/software_release/bin/python_for_test setup.py test
# run test (with debugging features activated)
SLAPOS_TEST_DEBUG= 1 python_for_test setup.py test
```
## Environment variables
The `environment-script` set all variabels except `SLAPOS_TEST_DEBUG` and `SLAPOS_TEST_VERBOSE` for you, but for reference, here is the list of variables which control the test runner:
| Variable | Description |
| --- | --- |
| `SLAPOS_TEST_IPV6` | ipv6 used by this instance. Usually you want to use a global address here to be able to connect to this instance. |
...
...
@@ -82,4 +78,7 @@ To use a development version of `slapos.cookbook` on test nodes, you can try usi
### Test pass locally but fail on test nodes, what can I do ?
At the end of the test, a snapshot of the slapos instances is created. Sometimes examining the log files can help understanding what went wrong.
\ No newline at end of file
At the end of the test, a snapshot of the slapos instances is created. Sometimes examining the log files can help understanding what went wrong.
Most of the time, problems are because on test nodes paths are very long. One advanced technique to reproduce the problem in your development environment is to set `SLAPOS_TEST_WORKING_DIR` environment variable to a path with the same length as the ones on test nodes.
One way to make instances uses a slightly shorter path is to define `__partition_reference__` class attribute, so that the instances uses this as prefix instead of the class name.