Commit 7ee6686b authored by wutu's avatar wutu

优化utils中的测试类

parent 028a177e
Pipeline #105 passed with stage
in 0 seconds
......@@ -38,7 +38,9 @@ public class DockerServiceTests {
@Test
public void testSudo() {
String result = linuxCtlService.runCmd("ovs-vsctl show");
System.out.println(result);
if("".equals(result) || result.toLowerCase().contains("error")) {
Assert.fail(result);
}
}
/*@Test
......@@ -53,7 +55,6 @@ public class DockerServiceTests {
@Test
public void testRunDockerService() {
DockerContainer container = new DockerContainer();
List<String> names = new ArrayList<String>();
container.setName("Router4");
container.setImage("joliu/networktest");
container.setCommand("sh");
......@@ -61,7 +62,7 @@ public class DockerServiceTests {
DockerContainer dockerContainer = dockerService.runDocker(container);
Assert.assertTrue(dockerService.deleteDockerById(dockerContainer.getId()));
} catch (RuntimeException ex) {
Assert.assertEquals("Run Docker failed!", ex.getMessage());
Assert.fail(ex.getMessage());
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment