Performing tests on files and directories in Hadoop HDFS using the 'test' command in the file system shell to check for existence, type, and permissions.