Skip to content

Instantly share code, notes, and snippets.

@srhb
Created October 10, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srhb/cf0ce27906b9dc27c1e60df9bd2041b6 to your computer and use it in GitHub Desktop.
Save srhb/cf0ce27906b9dc27c1e60df9bd2041b6 to your computer and use it in GitHub Desktop.
{ system ? builtins.currentSystem,
config ? {},
pkgs ? import <nixpkgs> { inherit system config; overlays = []; }
}:
with import (pkgs.path + /nixos/lib/testing.nix) { inherit system pkgs; };
with pkgs.lib;
let
mac1 = "6a:bb:84:02:50:c4";
mac2 = "6a:bb:84:02:50:c5";
in
makeTest {
name = "bond-hwaddr-shenanigans";
machine = { config, pkgs, ... }: {
virtualisation.vlans = [ 1 2 3 ];
networking = {
interfaces.eth1.macAddress = mac1;
interfaces.eth1.ipv4.addresses = mkOverride 0 [];
interfaces.eth2.macAddress = mac2;
interfaces.eth2.ipv4.addresses = mkOverride 0 [];
bonds.bond.interfaces = [ "eth1" "eth2" ];
bonds.bond.driverOptions.mode = "802.3ad";
};
};
testScript = ''
startAll;
$machine->waitUntilSucceeds('ip a | grep ${mac1}');
$machine->succeed('systemctl restart bond-netdev.service');
$machine->succeed('ip a | grep ${mac1}');
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment