Skip to content

Commit

Permalink
Merge pull request #504 from simondeziel/misc-fixes
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
stgraber authored Mar 31, 2022
2 parents bcdf9a5 + cb6616b commit 48d1a8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ These are the contributors to pylxd according to the Github repository.
anneborcherding Anne Borcherding
cpg1111 Christian Grabowski (Canonical)
fliiiix Felix
simondeziel Simon Déziel (Canonical)
=============== ==================================

13 changes: 5 additions & 8 deletions integration/run-integration-tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sudo apt update
sudo apt install -y \
build-essential \
busybox-static \
libffi-dev \
libssl-dev \
python3-dev \
Expand All @@ -15,15 +16,11 @@ lxc config set core.https_address "[::]"
# generate an openssl certificate and key for the remote not verified test
config_dir="$HOME/.config/lxc"
mkdir -p "$config_dir"
openssl genrsa 2048 > "$config_dir/client.key"
chmod 400 "$config_dir/client.key"
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 -sha384 \
-keyout "$config_dir/client.key" -out "$config_dir/client.crt" \
-nodes -subj "/CN=example.com" -days 3650

openssl req -new -x509 -nodes -sha1 -days 365 \
-key "$config_dir/client.key" -out "$config_dir/client.crt" \
-subj="/C=UK/ST=London/L=London/O=OrgName/OU=Test/CN=example.com"


if ! lxc storage show default ; then
if ! lxc storage show default >/dev/null 2>&1; then
lxc storage create default dir
lxc profile device add default root disk path=/ pool=default
fi
Expand Down
20 changes: 6 additions & 14 deletions migration/run_migration_integration_tests-18-04
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ lxc exec "$CONTAINER_ONE_NAME" -- apt install -y tox python3-dev libssl-dev libf
lxc exec "$CONTAINER_ONE_NAME" -- lxc config set core.trust_password password
lxc exec "$CONTAINER_ONE_NAME" -- lxc config set core.https_address "[::]"
lxc exec "$CONTAINER_ONE_NAME" -- mkdir -p /root/.config/lxc
openssl genrsa 1024 > ./"$CONTAINER_ONE_NAME".key
lxc file push ./"$CONTAINER_ONE_NAME".key "$CONTAINER_ONE_NAME"/root/.config/lxc/client.key
rm ./"$CONTAINER_ONE_NAME".key
lxc exec "$CONTAINER_ONE_NAME" -- chmod 400 /root/.config/lxc/client.key
lxc exec "$CONTAINER_ONE_NAME" -- openssl req -new -x509 -nodes -sha1 -days 365 \
-key /root/.config/lxc/client.key -out /root/.config/lxc/client.crt \
-subj="/C=UK/ST=London/L=London/O=OrgName/OU=Test/CN=example.com"
lxc exec "$CONTAINER_ONE_NAME" -- openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 \
-sha384 -keyout /root/.config/lxc/client.key -out /root/.config/lxc/client.crt -nodes \
-subj "/CN=example.com" -days 3650

# create a default dir storage pool for bionic
lxc exec "$CONTAINER_ONE_NAME" -- lxc storage create default dir
Expand All @@ -58,13 +54,9 @@ lxc exec "$CONTAINER_TWO_NAME" -- apt install -y tox python3-dev libssl-dev libf
lxc exec "$CONTAINER_TWO_NAME" -- lxc config set core.trust_password password
lxc exec "$CONTAINER_TWO_NAME" -- lxc config set core.https_address "[::]:8443"
lxc exec "$CONTAINER_ONE_NAME" -- mkdir -p /root/.config/lxc
openssl genrsa 1024 > ./"$CONTAINER_TWO_NAME".key
lxc file push ./"$CONTAINER_TWO_NAME".key "$CONTAINER_TWO_NAME"/root/.config/lxc/client.key
rm ./"$CONTAINER_TWO_NAME".key
lxc exec "$CONTAINER_TWO_NAME" -- chmod 400 /root/.config/lxc/client.key
lxc exec "$CONTAINER_TWO_NAME" -- openssl req -new -x509 -nodes -sha1 -days 365 \
-key /root/.config/lxc/client.key -out /root/.config/lxc/client.crt \
-subj="/C=UK/ST=London/L=London/O=OrgName/OU=Test/CN=example.com"
lxc exec "$CONTAINER_TWO_NAME" -- openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 \
-sha384 -keyout /root/.config/lxc/client.key -out /root/.config/lxc/client.crt -nodes \
-subj "/CN=example.com" -days 3650

# create a default dir storage pool for bionic
lxc exec "$CONTAINER_TWO_NAME" -- lxc storage create default dir
Expand Down

0 comments on commit 48d1a8c

Please sign in to comment.