Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Commit 1df70c8

Browse files
committed
test: tidy up adhoc lxd spread provider
1 parent 9a13196 commit 1df70c8

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

spread.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,21 @@ backends:
99
lxd:
1010
type: adhoc
1111
allocate: |
12-
BASE="${SPREAD_SYSTEM/-/:}"
13-
CONTAINER_NAME="${CONTAINER_NAME:-oxidizr-${SPREAD_SYSTEM/./-}-${RANDOM}}"
14-
15-
cloud_config="$(mktemp)"
16-
sed "s|SPREAD_PASSWORD|$SPREAD_PASSWORD|g" tests/cloud-config.yaml > "$cloud_config"
12+
CONTAINER_NAME="${oxidizr-${SPREAD_SYSTEM/./-}-${RANDOM}}"
1713
1814
lxc launch \
19-
"${BASE}" \
15+
"${SPREAD_SYSTEM/-/:}" \
2016
"${CONTAINER_NAME}" \
21-
-c user.user-data="$(cat "$cloud_config")"
17+
-c user.user-data="$(sed "s|SPREAD_PASSWORD|$SPREAD_PASSWORD|g" tests/cloud-config.yaml)"
2218
2319
# Wait for the spread user
2420
while ! lxc exec "${CONTAINER_NAME}" -- id -u spread &>/dev/null; do sleep 0.5; done
2521
26-
rm "$cloud_config"
27-
2822
# Set the instance address for spread
2923
ADDRESS "$(lxc ls -f csv | grep "${CONTAINER_NAME}" | cut -d"," -f3 | cut -d" " -f1)"
3024
discard: |
3125
instance_name="$(lxc ls -f csv | grep oxidizr | grep $SPREAD_SYSTEM_ADDRESS | cut -f1 -d",")"
3226
lxc delete -f $instance_name
33-
3427
systems:
3528
- ubuntu-24.04:
3629
username: spread

src/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ struct Args {
2929
)]
3030
yes: bool,
3131

32+
#[arg(
33+
short,
34+
long,
35+
default_values_t = vec!["coreutils".to_string(), "findutils".to_string(), "diffutils".to_string()],
36+
global = true,
37+
help = "Select experiments to enable or disable"
38+
)]
39+
experiments: Vec<String>,
40+
3241
#[command(subcommand)]
3342
cmd: Commands,
3443
}

0 commit comments

Comments
 (0)