Regression test portability: truncate, md5

Add shell functions to replace truncate and md5, which are Linux specific
Resubmit because of failed regression test with no apparent cause

BUG: 764655
Change-Id: I07200cf886bd52904a5cf63c66f43f0b1cc91540
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8341
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>