Section 25. No person commissioned as an officer or appointed as a warrant officer in the national guard, army or air, shall enter upon the performance of official duties or exercise any command unless possessing such minimum qualifications, and shall have passed such other tests as to the person's physical, moral and professional fitness, as are prescribed by the laws of the United States, and shall have taken and subscribed to the oath of office. The commander-in-chief shall forthwith discharge, or place upon the retired list under section thirty-one, unless further time is allowed for cause, any officer failing to pass the tests required by this chapter or the laws of the United States and the regulations issued thereunder.