  Cosmological tests to distinguish between dark energy (DE) and modifications
to gravity are a promising route to obtain clues on the origin of cosmic
acceleration. We study here the robustness of these tests to the presence of DE
density, velocity, and anisotropic stress perturbations. We find that the
dispersion in the growth index parameter remains small enough to distinguish
between extreme cases of DE models and some commonly used modified gravity
models. The sign of the slope parameter for a redshift dependent growth index
was found to be inconsistent as an additional test in extreme cases of DE
models with perturbations. Next, we studied the effect of DE perturbations on
the modified growth (MG) parameters that enter the perturbed Einstein
equations. We find that while the dark energy perturbations affect the MG
parameters, the deviations remain smaller than those due to modified gravity
models. Additionally, the deviations due to DE perturbations with a non-zero
effective sound speed occur at scale ranges that are completely different than
those due to some modified gravity models such as the $f(R)$ models. In the
case of modified gravity models with zero anisotropic stress at late times, the
simultaneous determination of the effective dark energy equation of state and
the MG parameters can provide the distinction between these models and DE. The
growth index test was found to be the most robust to these perturbations. The
scale dependence of the MG parameters in some cases of modified gravity
constitute a clear-cut discriminant regardless of any DE perturbations. In
summary, we find that the currently proposed cosmological tests to distinguish
between DE and modified gravity are robust to DE perturbations even for extreme
cases. This is certainly the case even for DE models with equations of state of
DE that fall well outside of current cosmological constraints.
