The detection of gravitational waves by Advanced LIGO and Advanced Virgo provides an opportunity to test general relativity in a regime that is inaccessible to traditional astronomical observations and laboratory tests. We present four tests of the consistency of the data with binary black hole gravitational waveforms predicted by general relativity. One test subtracts the best-fit waveform from the data and checks the consistency of the residual with detector noise. The second test checks the consistency of the low- and high-frequency parts of the observed signals. The third test checks that phenomenological deviations introduced in the waveform model (including in the post-Newtonian coefficients) are consistent with zero. The fourth test ...