That is a really good question, and a question that people agonize over constantly.
When Zen was associated with swordsmanship and Bushido in Japanese culture they simply used to wait until the battle was over. Who ever was left standing was clearly a master. Those who got stabbed obviously didn't know Zen.
But not all Zen masters know how to fight. My recommendation to anyone interested in studying Zen is to track down and read biographies of celebrated Zen masters. When you're reading them look at how these celebrated masters challenged their teachers to prove they were worthy. These people are constantly messing with each other.
A part of what fascinates me about studying Zen is its ability to impart useful knowledge via anecdote and narrative. History probably added some embellishments, but that's part of the fun.
How can a new practitioner know if the instructor is actually enlightened or is only saying they are enlightened?