Normally the data needed for testing is downloaded during the "ctest" (or "make check") step but you can also download all the data from here:

eccodes_test_data.tar.gz

Untar this into the top-level of the CMake "build" directory, not the source directory.