|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.kernel.filesys.test.FileSystemTest
public class FileSystemTest
This class implements some simple test routines for the file system. We implement: Copy -- copy a file from UNIX to Nachos; Print -- cat the contents of a Nachos file; Perftest -- a stress test for the Nachos file system read and write a really large file in tiny chunks (won't work on baseline system!).
Field Summary | |
---|---|
private static byte[] |
Contents
Bytes in the test data. |
private static int |
ContentSize
Length of the test data. |
private static java.lang.String |
ContentString
Test data to be written to the file in the performance test. |
private static java.lang.String |
FileName
Name of the file to create for the performance test. |
private static int |
FileSize
Total size of the test file. |
private static int |
TransferSize
Transfer data in small chunks, just to be difficult. |
Constructor Summary | |
---|---|
FileSystemTest()
|
Method Summary | |
---|---|
private static boolean |
byteCmp(byte[] a,
byte[] b,
int len)
Compare two byte arrays to see if they agree up to a specified length. |
private static void |
copy(java.lang.String from,
java.lang.String to)
Copy the contents of the host file "from" to the Nachos file "to" |
private static void |
fileRead()
Read and verify the file for the performance test. |
private static void |
fileWrite()
Write the test file for the performance test. |
private static void |
performanceTest()
Stress the Nachos file system by creating a large file, writing it out a bit at a time, reading it back a bit at a time, and then deleting the file. |
private static void |
print(java.lang.String name)
Print the contents of the Nachos file "name". |
static void |
start(java.lang.String[] args)
Entry point for the filesystem test. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int TransferSize
private static final java.lang.String FileName
private static final java.lang.String ContentString
private static final int ContentSize
private static final byte[] Contents
private static final int FileSize
Constructor Detail |
---|
public FileSystemTest()
Method Detail |
---|
private static void copy(java.lang.String from, java.lang.String to)
from
- The name of the file to be copied from the host filesystem.to
- The name of the file to create on the Nachos filesystem.private static void print(java.lang.String name)
name
- The name of the file to print.private static void performanceTest()
private static void fileWrite()
private static void fileRead()
private static boolean byteCmp(byte[] a, byte[] b, int len)
a
- The first byte array.b
- The second byte array.len
- The number of bytes to compare.
public static void start(java.lang.String[] args)
args
- The command-line arguments.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |