Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Joanne Hugé
slapos
Commits
44d2ecbc
Commit
44d2ecbc
authored
Mar 27, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slaprunner/test: use slapos.testing
parent
1aaaa03c
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
350 deletions
+14
-350
software/slaprunner/test/setup.py
software/slaprunner/test/setup.py
+2
-3
software/slaprunner/test/test.py
software/slaprunner/test/test.py
+12
-25
software/slaprunner/test/utils.py
software/slaprunner/test/utils.py
+0
-322
No files found.
software/slaprunner/test/setup.py
View file @
44d2ecbc
...
@@ -25,12 +25,11 @@
...
@@ -25,12 +25,11 @@
#
#
##############################################################################
##############################################################################
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
import
glob
import
os
version
=
'0.0.1.dev0'
version
=
'0.0.1.dev0'
name
=
'slapos.test.slaprunner'
name
=
'slapos.test.slaprunner'
long_description
=
open
(
"README.md"
).
read
()
with
open
(
"README.md"
)
as
f
:
long_description
=
f
.
read
()
setup
(
name
=
name
,
setup
(
name
=
name
,
version
=
version
,
version
=
version
,
...
...
software/slaprunner/test/test.py
View file @
44d2ecbc
...
@@ -26,35 +26,21 @@
...
@@ -26,35 +26,21 @@
##############################################################################
##############################################################################
import
os
import
os
import
shutil
import
urlparse
import
tempfile
import
requests
import
socket
import
StringIO
import
subprocess
import
json
import
psutil
import
utils
from
slapos.recipe.librecipe
import
generateHashFromFiles
from
slapos.recipe.librecipe
import
generateHashFromFiles
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
# for development: debugging logs and install Ctrl+C handler
setUpModule
,
SlapOSInstanceTestCase
=
makeModuleSetUpAndTestCaseClass
(
if
os
.
environ
.
get
(
'SLAPOS_TEST_DEBUG'
):
os
.
path
.
abspath
(
import
logging
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software.cfg'
)))
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
import
unittest
unittest
.
installHandler
()
class
InstanceTestCase
(
utils
.
SlapOSInstanceTestCase
):
class
SlaprunnerTestCase
(
SlapOSInstanceTestCase
):
@
classmethod
# Slaprunner uses unix sockets, so it needs short paths.
def
getSoftwareURLList
(
cls
):
__partition_reference__
=
's'
return
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software.cfg'
)),
)
class
ServicesTestCase
(
InstanceTestCase
):
class
ServicesTestCase
(
SlaprunnerTestCase
):
def
test_hashes
(
self
):
def
test_hashes
(
self
):
hash_files
=
[
hash_files
=
[
'software_release/buildout.cfg'
,
'software_release/buildout.cfg'
,
...
@@ -71,9 +57,10 @@ class ServicesTestCase(InstanceTestCase):
...
@@ -71,9 +57,10 @@ class ServicesTestCase(InstanceTestCase):
'supervisord-{hash}-on-watch'
,
'supervisord-{hash}-on-watch'
,
]
]
supervisor
=
self
.
getSupervisorRPCServer
().
supervisor
with
self
.
slap
.
instance_supervisor_rpc
as
supervisor
:
process_names
=
[
process
[
'name'
]
process_names
=
[
for
process
in
supervisor
.
getAllProcessInfo
()]
process
[
'name'
]
for
process
in
supervisor
.
getAllProcessInfo
()
]
hash_files
=
[
os
.
path
.
join
(
self
.
computer_partition_root_path
,
path
)
hash_files
=
[
os
.
path
.
join
(
self
.
computer_partition_root_path
,
path
)
for
path
in
hash_files
]
for
path
in
hash_files
]
...
...
software/slaprunner/test/utils.py
deleted
100644 → 0
View file @
1aaaa03c
This diff is collapsed.
Click to expand it.
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