Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-WIC-Cnf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CommunityXG
OpenXG-WIC-Cnf
Commits
7ee6686b
Commit
7ee6686b
authored
Jun 22, 2020
by
wutu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化utils中的测试类
parent
028a177e
Pipeline
#105
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
cnf-utils/src/test/java/top/ninwoo/utils/DockerServiceTests.java
...ls/src/test/java/top/ninwoo/utils/DockerServiceTests.java
+4
-3
No files found.
cnf-utils/src/test/java/top/ninwoo/utils/DockerServiceTests.java
View file @
7ee6686b
...
@@ -38,7 +38,9 @@ public class DockerServiceTests {
...
@@ -38,7 +38,9 @@ public class DockerServiceTests {
@Test
@Test
public
void
testSudo
()
{
public
void
testSudo
()
{
String
result
=
linuxCtlService
.
runCmd
(
"ovs-vsctl show"
);
String
result
=
linuxCtlService
.
runCmd
(
"ovs-vsctl show"
);
System
.
out
.
println
(
result
);
if
(
""
.
equals
(
result
)
||
result
.
toLowerCase
().
contains
(
"error"
))
{
Assert
.
fail
(
result
);
}
}
}
/*@Test
/*@Test
...
@@ -53,7 +55,6 @@ public class DockerServiceTests {
...
@@ -53,7 +55,6 @@ public class DockerServiceTests {
@Test
@Test
public
void
testRunDockerService
()
{
public
void
testRunDockerService
()
{
DockerContainer
container
=
new
DockerContainer
();
DockerContainer
container
=
new
DockerContainer
();
List
<
String
>
names
=
new
ArrayList
<
String
>();
container
.
setName
(
"Router4"
);
container
.
setName
(
"Router4"
);
container
.
setImage
(
"joliu/networktest"
);
container
.
setImage
(
"joliu/networktest"
);
container
.
setCommand
(
"sh"
);
container
.
setCommand
(
"sh"
);
...
@@ -61,7 +62,7 @@ public class DockerServiceTests {
...
@@ -61,7 +62,7 @@ public class DockerServiceTests {
DockerContainer
dockerContainer
=
dockerService
.
runDocker
(
container
);
DockerContainer
dockerContainer
=
dockerService
.
runDocker
(
container
);
Assert
.
assertTrue
(
dockerService
.
deleteDockerById
(
dockerContainer
.
getId
()));
Assert
.
assertTrue
(
dockerService
.
deleteDockerById
(
dockerContainer
.
getId
()));
}
catch
(
RuntimeException
ex
)
{
}
catch
(
RuntimeException
ex
)
{
Assert
.
assertEquals
(
"Run Docker failed!"
,
ex
.
getMessage
());
Assert
.
fail
(
ex
.
getMessage
());
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment