Skip to content

Commit 9732244

Browse files
committed
XXX: migration test progress with encryption
1 parent 70e56c0 commit 9732244

4 files changed

Lines changed: 35 additions & 5 deletions

File tree

modules/testing/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ let
4040
];
4141

4242
environment.variables = adminEnv;
43+
4344
# pw: root
4445
users.users.root.hashedPassword = lib.mkForce "$y$j9T$HiT/m702z/73g4Dt5RzbW0$b3SaYI1FoyT/ORV/qFR/s9zonJBKDn4p2XKyYM2wp1.";
4546
users.users.root.hashedPasswordFile = null;
4647

48+
# Workaround bug preventing SSH connection
49+
environment.etc."ssh/ssh_config".enable = false;
50+
4751
services.openssh = {
4852
enable = true;
4953
ports = [ 22 ];

tests/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let
1111
inherit nixosModules novaPkg libvirt;
1212
};
1313
openstack-live-migration = pkgs.callPackage ./openstack-live-migration.nix {
14-
inherit nixosModules generateRootwrapConf;
14+
inherit nixosModules generateRootwrapConf novaPkg;
1515
};
1616
};
1717
in

tests/openstack-default-setup.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
pkgs,
33
nixosModules,
44
novaPkg,
5-
libvirt,
65
}:
76
pkgs.nixosTest {
87
name = "OpenStack default setup test";
@@ -25,7 +24,7 @@ pkgs.nixosTest {
2524
nodes.computeVM =
2625
{ ... }:
2726
{
28-
virtualisation.libvirtd.package = libvirt;
27+
#virtualisation.libvirtd.package = libvirt;
2928
imports = [
3029
nixosModules.computeModule
3130
nixosModules.testModules.testCompute

tests/openstack-live-migration.nix

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
pkgs,
33
nixosModules,
44
generateRootwrapConf,
5+
novaPkg,
56
}:
67
let
78
novaConfigForIp =
89
ip:
910
{ config, pkgs, ... }:
1011
{
12+
nova.novaPackage = novaPkg;
1113
nova.config =
1214
let
1315
nova_env = pkgs.python3.buildEnv.override {
@@ -58,8 +60,9 @@ let
5860
5961
[libvirt]
6062
virt_type = kvm
61-
cpu_mode = custom
62-
cpu_model = qemu64
63+
images_type = default
64+
images_format = raw
65+
force_raw_images = true
6366
6467
[neutron]
6568
auth_url = http://controller:5000
@@ -109,6 +112,9 @@ let
109112
110113
[os_region_name]
111114
openstack =
115+
116+
[cinder]
117+
os_region_name = RegionOne
112118
'';
113119
};
114120
in
@@ -174,6 +180,15 @@ pkgs.nixosTest {
174180
systemd.network.networks.eth1.networkConfig.Address = pkgs.lib.mkForce "10.0.0.40/24";
175181
};
176182

183+
nodes.storageVM =
184+
{ ... }:
185+
{
186+
imports = [
187+
nixosModules.storageModule
188+
nixosModules.testModules.testStorage
189+
];
190+
};
191+
177192
testScript =
178193
{ ... }:
179194
''
@@ -270,6 +285,18 @@ pkgs.nixosTest {
270285
271286
assert retry_until_succeed(controllerVM, f"ip netns exec {net_ns} ping -c 1 {vm_ip}", 30)
272287
288+
# create volume with 4GB
289+
controllerVM.execute("openstack volume type create --encryption-provider luks --encryption-cipher aes-xts-plain64 --encryption-key-size 256 --encryption-control-location front-end nfs-luks")
290+
controllerVM.execute("openstack volume type set nfs-luks --property volume_backend_name=NFS")
291+
controllerVM.execute("openstack volume create --size 1 --type nfs-luks test_vol")
292+
293+
time.sleep(10)
294+
295+
# attach volume to VM
296+
controllerVM.execute("openstack server add volume test_vm test_vol")
297+
298+
breakpoint()
299+
273300
print(f"Start migration from src: {host} to destination {dst_host}")
274301
controllerVM.succeed(f"openstack server migrate --live-migration --host {dst_host} test_vm")
275302

0 commit comments

Comments
 (0)