Skip to content

Commit 3814130

Browse files
committed
Add and export SCC PTF grains
sumaform validation defaults default no default refactoring
1 parent bc44a3c commit 3814130

File tree

8 files changed

+45
-9
lines changed

8 files changed

+45
-9
lines changed

README_TESTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ module "cucumber_testsuite" {
1717
cc_username = ...
1818
cc_password = ...
1919
20+
cc_ptf_username = ...
21+
cc_ptf_password = ...
22+
2023
name_prefix = "moio-"
2124
domain = "tf.local"
2225
git_username = ...
@@ -31,6 +34,7 @@ module "cucumber_testsuite" {
3134
This will create a test server, client and minion instances, plus a coordination node called a `controller` which runs the testsuite.
3235

3336
The example will have to be completed with SCC credentials and GitHub credentials to the SUSE Manager or Uyuni repo.
37+
PTF SCC variables should only be used with SUSE Manager or Multi-Linux Manager versions later than 5.0.
3438

3539
`product_version` determines the version under test, see [README_ADVANCED.md](README_ADVANCED.md) for the list of options.
3640

main.tf.aws-testsuite.example

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ module "cucumber_testsuite" {
1717
product_version = "uyuni-master"
1818
branch = "master"
1919

20-
cc_username = ...
21-
cc_password = ...
20+
cc_username = ...
21+
cc_password = ...
22+
cc_ptf_username = ...
23+
cc_ptf_password = ...
2224

2325
images = ["opensuse156o"]
2426

main.tf.libvirt-testsuite.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ module "cucumber_testsuite" {
2727
cc_username = ""
2828
cc_password = ""
2929

30+
# SUSE SCC credentials with PTFs available
31+
cc_ptf_username = ""
32+
cc_ptf_password = ""
33+
3034
# define what images should be used and uploaded
3135
# https://github.com/uyuni-project/sumaform/blob/master/backend_modules/libvirt/README.md#only-upload-a-subset-of-available-images
3236
# the following images are e.g. available:

modules/controller/main.tf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ module "controller" {
3232
roles = ["controller"]
3333
product_version = var.product_version
3434
grains = {
35-
cc_username = var.base_configuration["cc_username"]
36-
cc_password = var.base_configuration["cc_password"]
37-
git_username = var.git_username
38-
git_password = var.git_password
39-
git_repo = var.git_repo
40-
branch = var.branch == "default" ? var.testsuite-branch[var.base_configuration["product_version"]] : var.branch
41-
mirror = var.no_mirror == true ? null : var.base_configuration["mirror"]
35+
cc_username = var.base_configuration["cc_username"]
36+
cc_password = var.base_configuration["cc_password"]
37+
cc_ptf_username = var.cc_ptf_username
38+
cc_ptf_password = var.cc_ptf_password
39+
git_username = var.git_username
40+
git_password = var.git_password
41+
git_repo = var.git_repo
42+
branch = var.branch == "default" ? var.testsuite-branch[var.base_configuration["product_version"]] : var.branch
43+
mirror = var.no_mirror == true ? null : var.base_configuration["mirror"]
4244

4345
server = var.server_configuration["hostname"]
4446
proxy = var.proxy_configuration["hostname"]

modules/controller/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ variable "name" {
77
type = string
88
}
99

10+
variable "cc_ptf_username" {
11+
description = "username of SCC organization having PTFs available"
12+
type = string
13+
}
14+
15+
variable "cc_ptf_password" {
16+
description = "password of SCC organization having PTFs available"
17+
type = string
18+
}
19+
1020
variable "git_username" {
1121
description = "username for GitHub"
1222
type = string

modules/cucumber_testsuite/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,8 @@ module "controller" {
481481
branch = var.branch
482482
git_username = var.git_username
483483
git_password = var.git_password
484+
cc_ptf_username = var.cc_ptf_username
485+
cc_ptf_password = var.cc_ptf_password
484486
git_repo = var.git_repo
485487
git_profiles_repo = var.git_profiles_repo
486488
no_auth_registry = var.no_auth_registry

modules/cucumber_testsuite/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ variable "branch" {
100100
default = "default"
101101
}
102102

103+
variable "cc_ptf_username" {
104+
description = "username of SCC organization having PTFs available"
105+
type = string
106+
}
107+
108+
variable "cc_ptf_password" {
109+
description = "password of SCC organization having PTFs available"
110+
type = string
111+
}
112+
103113
variable "git_username" {
104114
description = "username for GitHub"
105115
type = string

salt/controller/bashrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ export BUILD_SOURCES="dist.nue.suse.com"
113113
# various test suite settings
114114
export GITPROFILES="{{ grains.get('git_profiles_repo') }}"
115115
{% if grains.get('cc_username') | default(false, true) %}export SCC_CREDENTIALS="{{ grains.get('cc_username') }}|{{ grains.get('cc_password') }}" {% else %}# no SCC Credentials defined {% endif %}
116+
{% if grains.get('cc_ptf_username') | default(false, true) %}export SCC_PTF_USER="{{ grains.get('cc_ptf_username') }}" {% else %}# no SCC PTF Credentials defined {% endif %}
117+
{% if grains.get('cc_ptf_password') | default(false, true) %}export SCC_PTF_PASSWORD="{{ grains.get('cc_ptf_password') }}" {% else %}# no SCC PTF Credentials defined {% endif %}
116118
export AUTH_REGISTRY_CREDENTIALS="{{ grains.get('auth_registry_username') }}|{{ grains.get('auth_registry_password') }}"
117119
{% if grains.get('auth_registry') | default(false, true) %}export AUTH_REGISTRY="{{ grains.get('auth_registry') }}" {% else %}# no authenticated registry defined {% endif %}
118120
{% if grains.get('no_auth_registry') | default(false, true) %}export NO_AUTH_REGISTRY="{{ grains.get('no_auth_registry') }}" {% else %}# no container registry defined {% endif %}

0 commit comments

Comments
 (0)