A network server can send a packet to the end-device to enter a test mode of operation. Test Mode can enable/disable ACK and echo payloads back to the test server. ADR can be used to change the datarate of the end-device.
TestMode is implemented in the LoRaWAN stack, the reference Semtech stack shows the client side functionality starting at line 705.
Full test documentation is available for LoRa Alliance members at https://lora-alliance.org/