summaryrefslogtreecommitdiff
path: root/scripts/test_module_load.py
blob: c96229b924528469607fe1a949dafd00a2da4a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3

import sys
import os

modules = {
  "intel": ["e1000", "e1000e", "igb", "ixgb", "ixgbe", "ixgbevf", "i40e", "i40evf"],
  "accel_ppp": ["ipoe"],
  "misc": ["wireguard"]
}

if __name__ == '__main__':
    success = True

    print("[load modules] Test execution started")
    for msk in modules:
        ms = modules[msk]
        for m in ms:
            # We want to uncover all modules that fail,
            # not fail at the first one
            try:
                os.system("modprobe {0}".format(m))
            except Exception as e:
                print("[load modules] Test [modprobe {0}] failed: {1}".format(module, e))
                success = False

    if not success:
        print("Test [load modules] failed")
        sys.exit(1)
    else:
        print("[load modules] Test succeeded")