Create temporary directories first.
Adapt the test case to saltstack/salt@70b26f30b