tests: explicit GID index zero is replaced by the configured index
Hello,
At rdma-core master a70151dfec390eb5f7fc5b266f51d601da2a7778, RDMATestCase.__init__ uses a truth-value check to choose between the gid_index argument and the configured GID. GID index 0 is valid, but an explicit argument of 0 is replaced by the configured value. The same constructor correctly treats a non-None gid_index as explicit when it sets gid_type, so the resulting index and selection mode can disagree.
This reproducer needs an in-place pyverbs build but does not access RDMA hardware. Run it from the repository root:
```sh
PYTHONPATH=build/python:tests python3 - <<'PY'
import sys
from unittest.mock import patch
sys.path.append(sys.path.pop(0)) # Prefer the built pyverbs over the source directory.
from tests.base import RDMATestCase
config = {'dev': None, 'port': 1, 'gid': 7}
with patch('tests.base.parser.get_config', return_value=config):
case = RDMATestCase(gid_index=0, gid_type=2)
print('gid_index:', case.gid_index, 'gid_type:', case.gid_type)
PY
```Observed: gid_index: 7 gid_type: None
Expected: gid_index: 0 gid_type: None
Checking gid_index is not None instead of its truth value preserves an explicit zero while retaining the existing fallback for None. Regression tests for zero, None, and a nonzero argument fail on the base only for zero and pass with that change. I reproduced this on Linux aarch64 with Python 3.12. No network or GPU traffic was run for this comparison.