Didn’t God know what he was going to do and what was going to happen, when He created satan?
The answer is yes.