Re-factor some of the tests.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Add more cases to the TestOpen test.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>