File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,14 @@ nix build .#tests.x86_64-linux.<test-name>.driverInteractive
7979./result/bin/nixos-test-driver
8080```
8181
82+ #### Dashboard access
83+
84+ The NixOS tests configure some port forwarding in order to allow access to the
85+ OpenStack dashboard. The port forwarding can be configured via
86+ ` openstack-testing.dashboardHostPort ` and the default host port used is ` 8080 ` .
87+ While a NixOS test is running, the dashboard can be accessed via
88+ ` 127.0.0.1:8080 ` or the configured host port.
89+
8290## Scope
8391
8492OpenStack is a very large and super actively maintained project. We are aware that we cannot keep track of all its development or offer every single configuration option via NixOS modules.
Original file line number Diff line number Diff line change 9191 username = nova
9292 password = nova
9393
94+ [serial_console]
95+ enabled = true
96+ serialproxy_host = 0.0.0.0
97+ proxyclient_address = $my_ip
98+
9499 [vnc]
95100 enabled = true
96101 server_listen = 0.0.0.0
Original file line number Diff line number Diff line change 5050 username = nova
5151 password = nova
5252
53+ [serial_console]
54+ enabled = true
55+
5356 [vnc]
5457 enabled = true
5558 server_listen = $my_ip
299302 TimeoutStopSec = 15 ;
300303 } ;
301304 } ;
305+
306+ systemd . services . nova-serialproxy = {
307+ description = "OpenStack Nova serial proxy" ;
308+ after = [
309+ "nova.service"
310+ "mysql.service"
311+ "keystone.service"
312+ "rabbitmq.service"
313+ "network-online.target"
314+ ] ;
315+ wants = [ "network-online.target" ] ;
316+ wantedBy = [ "multi-user.target" ] ;
317+ path = [ cfg . novaPackage ] ;
318+ serviceConfig = {
319+ User = "nova" ;
320+ Group = "nova" ;
321+ Type = "simple" ;
322+ ExecStart = pkgs . writeShellScript "nova-serialproxy.sh" ''
323+ nova-serialproxy --config-file ${ cfg . config }
324+ '' ;
325+ Restart = "on-failure" ;
326+ LimitNOFILE = 65535 ;
327+ TimeoutStopSec = 15 ;
328+ } ;
329+ } ;
302330 } ;
303331}
Original file line number Diff line number Diff line change 3838 environment . variables = adminEnv ;
3939 } ;
4040 } ;
41+
42+ portForwarding =
43+ { config , lib , ... } :
44+ with lib ;
45+ let
46+ cfg = config . openstack-testing ;
47+ in
48+ {
49+ options . openstack-testing = {
50+ enable = mkEnableOption "Enable port forwarding." // {
51+ default = true ;
52+ } ;
53+ dashboardHostPort = mkOption {
54+ default = 8080 ;
55+ type = types . port ;
56+ description = ''
57+ Host port to make the OpenStack dashboard accessible when running
58+ the OpenStack controller in a VM. Dashboard can be accessed via:
59+ localhost:<dashboardHostPort>
60+ '' ;
61+ } ;
62+ serialProxyHostPort = mkOption {
63+ default = 6083 ;
64+ type = types . port ;
65+ description = ''
66+ Host port to make the web console feature available for the
67+ OpenStack dashboard. Changing the value might requires to change
68+ the configuration of the dashboard.
69+ '' ;
70+ } ;
71+ } ;
72+ config = mkIf cfg . enable {
73+ virtualisation . forwardPorts = [
74+ {
75+ from = "host" ;
76+ host . port = cfg . dashboardHostPort ;
77+ guest . port = 80 ;
78+ }
79+ {
80+ from = "host" ;
81+ host . port = cfg . serialProxyHostPort ;
82+ guest . port = 6083 ;
83+ }
84+ ] ;
85+ } ;
86+ } ;
4187in
4288{
4389 testController =
4995 } ;
5096 in
5197 {
52- imports = [ common ] ;
98+ imports = [
99+ common
100+ portForwarding
101+ ] ;
53102
54103 virtualisation = {
55104 cores = 4 ;
You can’t perform that action at this time.
0 commit comments