Glass Box (or white box) testing is the process of giving i/p to the system and checking how the system processes i/p to generate o/p
Black Box testing is the process of giving i/p to the system and checking if the system is giving correct o/p without bothering how the o/p is generated.
As we can see from the definitions, the role of black box testing is to ensure that the o/p generated is correct. And role of white box testing is to ensure that methods used to generate the o/p are correct.