Yikes. 17 is really too young to be entering something as complex and burdensome as the family law system. I hate it even as a woman in my early-30s, and I couldn't imagine trying to get my head around it at the ripe age of 17. My heart goes out to you, your son and the child.
Okay, so, as in my answer above, the court will generally only order a DNA test if there's a need to determine parentage for the purpose of other proceedings. This means a party can't just go to court and say 'Hey, can you please order a DNA test so I have proof I'm the father?' There usually needs to be a legal reason for wanting that DNA test undertaken.
A legal reason might be an application for parenting orders (which are basically court orders for who the child lives with, spends time with, etc.), or for the purposes of child support where the father isn't named on the birth certificate.
In these circumstances, I would suggest the predominant legal reason for wanting a DNA test would be for the purposes of seeking parenting orders since you've stated your son is eager to spend time with the child if the child is his. So, in a very loose explanation of how this generally works: Apply for parenting orders --> Request interim order that DNA test be undertaken to determine parentage of child in order to establish that you are a person of relevance to the child's care, welfare or development --> proceed with parenting orders application in the event the DNA test is returned in your favour.
Before your son can apply for parenting orders, he must first attempt a family dispute resolution conference with the other parent. The purpose of this conference is for two parties to try and resolve their dispute with the guidance of a neutral third party and without the intervention of the court. Sometimes it works, sometimes it doesn't, but it's mandatory before any party can file an initiating application with the court for parenting orders.
My suggestion - and this isn't legal advice, just a suggestion - is that a family dispute resolution conference be first used to try and discuss the matter of parentage with the mother, because if the DNA test is undertaken and your son is found not to be the father, then both your son and the mother can avoid court and get on with your lives.
Hopefully, the mother will get legal advice before attending the family dispute resolution conference as it may save her a lot of time, money and emotional energy, but otherwise, your son may find that she refuses to participate or agreement can't be reached. In such circumstances, the mediator will grant a section 60I certificate which enables him to pursue parenting orders through the court.
I hope this helps.