tests: Honor explicit GID index zero
[ Upstream commit 6528313623fa43b54046d3c9ff85f46d629ad0c9 ]
An explicit gid_index of zero is valid but the test case constructor
currently replaces it with the configured value. Check for None so that
only an omitted index falls back to the configuration.
Fixes: edfef22595e4 ("tests: Add gid param to argument parser")
Signed-off-by: Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
diff --git a/tests/base.py b/tests/base.py
index 76364bf..ea29a8b 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -155,7 +155,7 @@
dev = self.config['dev']
self.dev_name = dev_name if dev_name else dev
self.ib_port = ib_port if ib_port else self.config['port']
- self.gid_index = gid_index if gid_index else self.config['gid']
+ self.gid_index = gid_index if gid_index is not None else self.config['gid']
self.pkey_index = pkey_index
self.gid_type = gid_type if gid_index is None else None
self.ip_addr = None