copy input and write out used config before test
always keep globals in local state for function entry