#!/bin/bash

IQN=$1

if [[ -z "${IQN}" ]]; then
	echo "usage: $0 TargetIQN"
        echo ""

	exit
fi

if [[ ! -d "/mnt/iSCSI_${IQN}" ]]; then
	echo "IQN ${IQN} is not mounted"
        echo ""

	exit
fi

dd if=/dev/zero of=/mnt/iSCSI_${IQN}/test1.img bs=1G count=1 oflag=dsync
dd if=/dev/zero of=/mnt/iSCSI_${IQN}/test2.img bs=512 count=1000 oflag=dsync

rm -f /mnt/iSCSI_${IQN}/test1.img
rm -f /mnt/iSCSI_${IQN}/test2.img

