Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Léo-Paul Géneau
slapos.core
Commits
fe539da3
Commit
fe539da3
authored
Nov 16, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_slapgrid: check that $HOME is set when processing partition
Some buildout profiles are expecting this.
parent
7dbf0ba4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
slapos/tests/test_slapgrid.py
slapos/tests/test_slapgrid.py
+11
-0
No files found.
slapos/tests/test_slapgrid.py
View file @
fe539da3
...
...
@@ -283,6 +283,17 @@ class TestBasicSlapgridCP(BasicMixin, unittest.TestCase):
os
.
mkdir
(
self
.
instance_root
)
self
.
assertRaises
(
ConnectionError
,
self
.
grid
.
processComputerPartitionList
)
def
test_environment_variable_HOME
(
self
):
# When running instance, $HOME is set to the partition path
computer
=
ComputerForTest
(
self
.
software_root
,
self
.
instance_root
)
partition
=
computer
.
instance_list
[
0
]
partition
.
requested_state
=
'started'
partition
.
software
.
setBuildout
(
'#!/bin/sh
\
n
echo $HOME > env_HOME'
)
with
httmock
.
HTTMock
(
computer
.
request_handler
):
self
.
assertEqual
(
self
.
grid
.
processComputerPartitionList
(),
slapgrid
.
SLAPGRID_SUCCESS
)
with
open
(
os
.
path
.
join
(
partition
.
partition_path
,
'env_HOME'
))
as
f
:
self
.
assertEqual
(
f
.
read
().
strip
(),
partition
.
partition_path
)
class
MasterMixin
(
BasicMixin
):
...
...
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