Every officer and warrant officer of the army or air national guard, except those for whom federal recognition is not required shall, upon the officer’s or warrant officer’s appointment to an office and assignment to a unit, upon official orders, appear before an examining board and successfully pass such test as to the officer’s or warrant officer’s physical, moral, and professional fitness as may be prescribed by the secretary of the army or the air force.