Test: cts-cli: functionize creating a shadow CIB
... to reduce code duplication, and make it easier to make changes