$ ./test.sh
bash: ./test.sh: Permission denied
This happens normally because you are on a partition that was mounted as "user" and without the exec option. Also be sure to add exec at the end so no other options set noexec.
Change your fstab or add exec to your mount options:
/dev/md127 /mnt/md127 ext4 auto,nofail,noatime,rw,user,exec 0 0
bash, execute, sh, partition, mounted, quot, user, exec, noexec, fstab, mount, dev, md, mnt, ext, auto, nofail, noatime, rw,