Skip to content
Snippets Groups Projects
Commit fe5029da authored by Guy Zana's avatar Guy Zana
Browse files

tests: add iterations to the TCPDownloadFile test

making it even more stressful ;)
parent 03fef2b5
No related branches found
No related tags found
No related merge requests found
...@@ -12,10 +12,9 @@ public class TCPDownloadFile implements Test { ...@@ -12,10 +12,9 @@ public class TCPDownloadFile implements Test {
public static final String _url = "http://mirror.isoc.org.il/pub/fedora/releases/18/Fedora/x86_64/iso/Fedora-18-x86_64-netinst.iso"; public static final String _url = "http://mirror.isoc.org.il/pub/fedora/releases/18/Fedora/x86_64/iso/Fedora-18-x86_64-netinst.iso";
public static final int _chunk_size = 0x10000; public static final int _chunk_size = 0x10000;
public static final String _expected_md5 = "227acebbc5392a4600349ae0c2d0ffcf"; public static final String _expected_md5 = "227acebbc5392a4600349ae0c2d0ffcf";
public static final int _max_iterations = 5;
@Override
public boolean run() { private boolean test() {
try { try {
URL url = new URL(_url); URL url = new URL(_url);
HttpURLConnection conn = (HttpURLConnection)url.openConnection(); HttpURLConnection conn = (HttpURLConnection)url.openConnection();
...@@ -72,5 +71,20 @@ public class TCPDownloadFile implements Test { ...@@ -72,5 +71,20 @@ public class TCPDownloadFile implements Test {
return (true); return (true);
} }
@Override
public boolean run() {
for (int i=0; i < _max_iterations; i++) {
System.out.format("Running iteration %d/%d\n", i+1,
_max_iterations);
boolean rc = this.test();
if (!rc) {
return (false);
}
}
return (true);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment