Tests for ioctl function