tests: Replace shell-based 'if' with 'AS_IF'

While the 'if' is technically correct, the 'AS_IF' is the suggested
approach for crossplatform-compatibility. More importantly, this also
fixes syntax highlighting in Vim and other editors.

Change-Id: Icad3b62e07a27883dc5c02a19c49f981582fad4d
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Kevin Traynor <kevin.traynor@intel.com>
Reviewed-by: Ian Stokes <ian.stokes@intel.com>