fixed test framework packet write/read