summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lamprecht <t.lamprecht@proxmox.com>2021-04-28 16:36:13 +0200
committerThomas Lamprecht <t.lamprecht@proxmox.com>2021-04-28 16:38:42 +0200
commit65723efd3888596eade4776a968bea36d8317928 (patch)
treec75b359427893e7408415e15a74dd56d5f36dd97
parentd73c7c366883f104e938ab29469cb48e958aebc5 (diff)
code/whitespace cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
-rw-r--r--PVE/Network/SDN/Controllers.pm4
-rw-r--r--PVE/Network/SDN/Zones.pm1
-rwxr-xr-xtest/run_test_zones.pl7
-rw-r--r--test/zones/evpn/ebgp/sdn_config71
4 files changed, 51 insertions, 32 deletions
diff --git a/PVE/Network/SDN/Controllers.pm b/PVE/Network/SDN/Controllers.pm
index d61851b..e1cf9e0 100644
--- a/PVE/Network/SDN/Controllers.pm
+++ b/PVE/Network/SDN/Controllers.pm
@@ -83,7 +83,7 @@ sub generate_controller_config {
my $interfaces_config = PVE::INotify::read_etc_network_interfaces(1,$fh);
$fh->close();
- #check uplinks
+ # check uplinks
my $uplinks = {};
foreach my $id (keys %{$interfaces_config->{ifaces}}) {
my $interface = $interfaces_config->{ifaces}->{$id};
@@ -94,7 +94,7 @@ sub generate_controller_config {
}
}
- #generate configuration
+ # generate configuration
my $config = {};
foreach my $id (sort keys %{$controller_cfg->{ids}}) {
diff --git a/PVE/Network/SDN/Zones.pm b/PVE/Network/SDN/Zones.pm
index e5c0240..1ccceed 100644
--- a/PVE/Network/SDN/Zones.pm
+++ b/PVE/Network/SDN/Zones.pm
@@ -227,7 +227,6 @@ sub status {
my $status = ifquery_check();
-
my $vnet_cfg = $cfg->{vnets};
my $zone_cfg = $cfg->{zones};
my $nodename = PVE::INotify::nodename();
diff --git a/test/run_test_zones.pl b/test/run_test_zones.pl
index a788553..12e017a 100755
--- a/test/run_test_zones.pl
+++ b/test/run_test_zones.pl
@@ -21,7 +21,7 @@ sub read_sdn_config {
open my $in, '<', $file or die $!;
my $sdn_config;
{
- local $/; # slurp mode
+ local $/; # slurp mode
$sdn_config = eval <$in>;
}
close $in;
@@ -92,7 +92,7 @@ foreach my $test (@tests) {
my $expected = read_file("./$test/expected_sdn_interfaces");
my $result = "";
- eval {
+ eval {
$result = PVE::Network::SDN::Zones::generate_etc_network_config();
};
@@ -106,11 +106,10 @@ foreach my $test (@tests) {
my $expected = read_file("./$test/expected_controller_config");
my $controller_rawconfig = "";
- eval {
+ eval {
my $config = PVE::Network::SDN::Controllers::generate_controller_config();
$controller_rawconfig = PVE::Network::SDN::Controllers::generate_controller_rawconfig($config);
};
-
if (my $err = $@) {
fail($name);
} else {
diff --git a/test/zones/evpn/ebgp/sdn_config b/test/zones/evpn/ebgp/sdn_config
index 91c1b61..6e9d116 100644
--- a/test/zones/evpn/ebgp/sdn_config
+++ b/test/zones/evpn/ebgp/sdn_config
@@ -1,29 +1,50 @@
{
- version => 1,
- vnets => {
- ids => {
- myvnet => { tag => "100", type => "vnet", zone => "myzone" },
- },
- },
+ version => 1,
+ vnets => {
+ ids => {
+ myvnet => {
+ tag => "100",
+ type => "vnet",
+ zone => "myzone",
+ },
+ },
+ },
- zones => {
- ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000 } },
- },
- controllers => {
- ids => {
- evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" },
- localhost => { type => "bgp", 'peers' => '192.168.0.252,192.168.0.253', ebgp => "1", 'ebgp-multihop' => '3', asn => "65001", node => "localhost" },
- },
- },
+ zones => {
+ ids => {
+ myzone => {
+ ipam => "pve",
+ type => "evpn",
+ controller => "evpnctl",
+ 'vrf-vxlan' => 1000,
+ },
+ },
+ },
+ controllers => {
+ ids => {
+ evpnctl => {
+ type => "evpn",
+ 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3',
+ asn => "65000",
+ },
+ localhost => {
+ type => "bgp",
+ 'peers' => '192.168.0.252,192.168.0.253',
+ ebgp => "1",
+ 'ebgp-multihop' => '3',
+ asn => "65001",
+ node => "localhost",
+ },
+ },
+ },
- subnets => {
- ids => { 'myzone-10.0.0.0-24' => {
- 'type' => 'subnet',
- 'vnet' => 'myvnet',
- 'gateway' => '10.0.0.1',
- }
- }
- }
+ subnets => {
+ ids => {
+ 'myzone-10.0.0.0-24' => {
+ 'type' => 'subnet',
+ 'vnet' => 'myvnet',
+ 'gateway' => '10.0.0.1',
+ },
+ },
+ },
}
-
-