Skip to content

Commit

Permalink
Add a 'scripts_data' provisioning variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyask committed Jan 18, 2024
1 parent abafc0d commit 278d044
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions upgrade_testing/configspec/_config.py
Expand Up @@ -66,6 +66,8 @@ def _reader(self, details):
)
)

self.scripts_data = details.get("scripts_data", None)

backend_args = details.get("backend_args", [])
self.backend_args = [
arg.format(scripts_location=self.scripts_location)
Expand Down
6 changes: 6 additions & 0 deletions upgrade_testing/preparation/_hostprep.py
Expand Up @@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

import json
import logging
import os
import shutil
Expand Down Expand Up @@ -75,6 +76,11 @@ def prepare_test_environment(testsuite):
scripts_path = os.path.join(temp_dir, "scripts")
_copy_script_files(testsuite.scripts_location, scripts_path)

if hasattr(testsuite, "scripts_data"):
data_path = os.path.join(temp_dir, "scripts_data.json")
with open(data_path, "w") as f:
json.dump(testsuite.scripts_data, f)

adt_base_path, adt_cmd = _get_adt_path(temp_dir)

yield TestrunTempFiles(
Expand Down

0 comments on commit 278d044

Please sign in to comment.