Skip to content

Commit b2e137d

Browse files
authored
Ci: Add secrets (#1249)
1 parent 277d62c commit b2e137d

File tree

4 files changed

+24
-14
lines changed

4 files changed

+24
-14
lines changed

.github/workflows/smoke-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ jobs:
131131
env:
132132
PYTEST_RETRIES: '3'
133133
steps:
134+
- name: Replace secrets in example config files
135+
run: |
136+
sed -i "s+MTL_PATH_PLACEHOLDER+${{ secrets.BARE_METAL_MTL_PATH }}+" tests/validation/configs/test_config.yaml
137+
sed -i "s/IP_ADDRESS_PLACEHOLDER/${{ secrets.BARE_METAL_IP_ADDRESS }}/" tests/validation/configs/topology_config.yaml
138+
sed -i "s/SSH_PORT_PLACEHOLDER/${{ secrets.BARE_METAL_SSH_PORT }}/" tests/validation/configs/topology_config.yaml
139+
sed -i "s/USERNAME_PLACEHOLDER/${{ secrets.BARE_METAL_USERNAME }}/" tests/validation/configs/topology_config.yaml
140+
sed -i "s+KEY_PATH_PLACEHOLDER+${{ secrets.BARE_METAL_SSH_KEY_PATH }}+" tests/validation/configs/topology_config.yaml
134141
- name: 'preparation: Harden Runner'
135142
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
136143
with:

tests/validation/configs/test_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
build: .
2-
mtl_path: .
1+
build: MTL_PATH_PLACEHOLDER
2+
mtl_path: MTL_PATH_PLACEHOLDER
33
media_path: /mnt/media
44
capture_cfg:
55
enable: false

tests/validation/configs/topology_config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@ hosts:
99
- pci_device: 8086:1592
1010
interface_index: 0 # all
1111
connections:
12-
- ip_address: 127.0.0.1
13-
connection_type: LocalConnection
12+
- ip_address: IP_ADDRESS_PLACEHOLDER
13+
connection_type: SSHConnection
14+
connection_options:
15+
port: SSH_PORT_PLACEHOLDER
16+
username: USERNAME_PLACEHOLDER
17+
password: None
18+
key_path: KEY_PATH_PLACEHOLDER

tests/validation/mtl_engine/ramdisk.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@ def __init__(self, host, mount_point, size_gib):
1010
self._size_gib = size_gib
1111

1212
def mount(self):
13-
cmd = f"mkdir -p {self._mount_point} && mount -t ramfs -o size={self._size_gib}G ramfs {self._mount_point}"
1413
try:
15-
self._host.connection.execute_command(cmd)
16-
except ConnectionCalledProcessError as e:
17-
logging.log(
18-
level=logging.ERROR, msg=f"Failed to execute command {cmd}: {e}"
14+
self._host.connection.execute_command(f"mkdir -p {self._mount_point}")
15+
self._host.connection.execute_command(
16+
f"mount -t ramfs -o size={self._size_gib}G ramfs {self._mount_point}"
1917
)
18+
except ConnectionCalledProcessError as e:
19+
logging.log(level=logging.ERROR, msg=f"Failed to execute command: {e}")
2020

2121
def unmount(self):
22-
cmd = f"umount {self._mount_point} && rmdir {self._mount_point}"
2322
try:
24-
self._host.connection.execute_command(cmd)
23+
self._host.connection.execute_command(f"umount {self._mount_point}")
24+
self._host.connection.execute_command(f"rmdir {self._mount_point}")
2525
except ConnectionCalledProcessError as e:
26-
logging.log(
27-
level=logging.ERROR, msg=f"Failed to execute command {cmd}: {e}"
28-
)
26+
logging.log(level=logging.ERROR, msg=f"Failed to execute command: {e}")

0 commit comments

Comments
 (0)