|
| 1 | +suite: test TFTP deployment |
| 2 | +templates: |
| 3 | + - templates/tftp.yaml |
| 4 | +tests: |
| 5 | + - it: should create the tftp deployment with default image |
| 6 | + set: |
| 7 | + global.config: | |
| 8 | + max_cache_size_mb: 2048 |
| 9 | + server: parent.example.org |
| 10 | + proxy_fqdn: proxy.example.org |
| 11 | + email: foo@example.org |
| 12 | + log_level: 2 |
| 13 | + global.httpd: "httpd_content: test httpd" |
| 14 | + global.ssh: "ssh_content: test ssh" |
| 15 | + release: |
| 16 | + namespace: proxy1 |
| 17 | + asserts: |
| 18 | + - containsDocument: |
| 19 | + kind: Deployment |
| 20 | + apiVersion: apps/v1 |
| 21 | + name: uyuni-proxy-tftp |
| 22 | + namespace: proxy1 |
| 23 | + |
| 24 | + - contains: |
| 25 | + path: spec.template.spec.containers |
| 26 | + any: true |
| 27 | + content: |
| 28 | + name: tftpd |
| 29 | + image: registry.opensuse.org/uyuni/shared-tftpd:latest |
| 30 | + imagePullPolicy: Always |
| 31 | + command: |
| 32 | + - /usr/bin/tftp_wrapper.py |
| 33 | + - --httpHost |
| 34 | + - web.proxy1.svc |
| 35 | + |
| 36 | + - it: should use top-level repository, tag and pullPolicy |
| 37 | + set: |
| 38 | + global.config: | |
| 39 | + max_cache_size_mb: 2048 |
| 40 | + server: parent.example.org |
| 41 | + proxy_fqdn: proxy.example.org |
| 42 | + email: foo@example.org |
| 43 | + log_level: 2 |
| 44 | + global.httpd: "httpd_content: test httpd" |
| 45 | + global.ssh: "ssh_content: test ssh" |
| 46 | + repository: my.custom.registry/uyuni |
| 47 | + tag: 5.2.3 |
| 48 | + pullPolicy: IfNotPresent |
| 49 | + asserts: |
| 50 | + - contains: |
| 51 | + path: spec.template.spec.containers |
| 52 | + content: |
| 53 | + name: tftpd |
| 54 | + image: my.custom.registry/uyuni/shared-tftpd:5.2.3 |
| 55 | + imagePullPolicy: IfNotPresent |
| 56 | + any: true |
| 57 | + |
| 58 | + - it: should use component-specific overrides |
| 59 | + set: |
| 60 | + global.config: | |
| 61 | + max_cache_size_mb: 2048 |
| 62 | + server: parent.example.org |
| 63 | + proxy_fqdn: proxy.example.org |
| 64 | + email: foo@example.org |
| 65 | + log_level: 2 |
| 66 | + global.httpd: "httpd_content: test httpd" |
| 67 | + global.ssh: "ssh_content: test ssh" |
| 68 | + tftp: { image: "custom/tftp", tag: "v5" } |
| 69 | + asserts: |
| 70 | + - contains: |
| 71 | + path: spec.template.spec.containers |
| 72 | + content: { name: tftpd, image: "custom/tftp:v5" } |
| 73 | + any: true |
| 74 | + |
| 75 | + - it: should include imagePullSecrets when registrySecret is provided |
| 76 | + set: |
| 77 | + global.config: | |
| 78 | + max_cache_size_mb: 2048 |
| 79 | + server: parent.example.org |
| 80 | + proxy_fqdn: proxy.example.org |
| 81 | + email: foo@example.org |
| 82 | + log_level: 2 |
| 83 | + global.httpd: "httpd_content: test httpd" |
| 84 | + global.ssh: "ssh_content: test ssh" |
| 85 | + registrySecret: "my-registry-key" |
| 86 | + asserts: |
| 87 | + - equal: |
| 88 | + path: spec.template.spec.imagePullSecrets[0].name |
| 89 | + value: "my-registry-key" |
| 90 | + |
| 91 | + - it: should set hostNetwork when requested |
| 92 | + set: |
| 93 | + global.config: | |
| 94 | + max_cache_size_mb: 2048 |
| 95 | + server: parent.example.org |
| 96 | + proxy_fqdn: proxy.example.org |
| 97 | + email: foo@example.org |
| 98 | + log_level: 2 |
| 99 | + global.httpd: "httpd_content: test httpd" |
| 100 | + global.ssh: "ssh_content: test ssh" |
| 101 | + tftp: |
| 102 | + hostNetwork: true |
| 103 | + asserts: |
| 104 | + - equal: |
| 105 | + path: spec.template.spec.hostNetwork |
| 106 | + value: true |
| 107 | + |
| 108 | + - equal: |
| 109 | + path: spec.template.spec.dnsPolicy |
| 110 | + value: ClusterFirstWithHostNet |
0 commit comments