Commit 053fe379 authored by zhifan huang's avatar zhifan huang

slapos-testing: add re6stnet tests

use unshare to create new user-root namesapce to have the perrmission to
create network device, use mount to update files information of network
device in /sys(nemu)
test use iptables to manage route condition, miniupnpd to manage upnp,
brctl(nemu) to create bridge, so add them in component.
parent 3c8fb3fa
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = df528e38ae84578f7001e29e41f89222 md5sum = 106f26c8ac19336ef93112a0e285099a
...@@ -82,12 +82,16 @@ repository = ${slapos.rebootstrap-repository:location} ...@@ -82,12 +82,16 @@ repository = ${slapos.rebootstrap-repository:location}
<= download-source <= download-source
repository = ${rubygemsrecipe-repository:location} repository = ${rubygemsrecipe-repository:location}
[re6stnet]
<= download-source
repository = ${re6stnet-repository:location}
[slapos-test-runner-nxdtest-environment.sh] [slapos-test-runner-nxdtest-environment.sh]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${create-directory:etc}/$${:_buildout_section_name_} rendered = $${create-directory:etc}/$${:_buildout_section_name_}
template = inline: template = inline:
export PATH=${coreutils:location}/bin:${curl:location}/bin:${openssl:location}/bin:${jq:location}/bin:${sed:location}/bin:${grep:location}/bin:${git:location}/bin:${libxslt:location}/bin:${socat:location}/bin:${lmsensors:location}/bin:${rsync:location}/bin/:${buildout:bin-directory}:$PATH export PATH=${coreutils:location}/bin:${curl:location}/bin:${openssl:location}/bin:${jq:location}/bin:${sed:location}/bin:${grep:location}/bin:${git:location}/bin:${libxslt:location}/bin:${socat:location}/bin:${lmsensors:location}/bin:${rsync:location}/bin/:${iptables:location}/sbin:${miniupnpd:location}/usr/sbin:${brctl:location}/sbin:${buildout:bin-directory}:$PATH
export SLAPOS_TEST_IPV4=$${slap-configuration:ipv4-random} export SLAPOS_TEST_IPV4=$${slap-configuration:ipv4-random}
export SLAPOS_TEST_IPV6=$${slap-configuration:ipv6-random} export SLAPOS_TEST_IPV6=$${slap-configuration:ipv6-random}
export SLAPOS_TEST_EGGS_DIRECTORY=$${buildout:eggs-directory} export SLAPOS_TEST_EGGS_DIRECTORY=$${buildout:eggs-directory}
...@@ -189,6 +193,12 @@ template = inline: ...@@ -189,6 +193,12 @@ template = inline:
# cwd="""$${rubygemsrecipe:location}""", # cwd="""$${rubygemsrecipe:location}""",
# summaryf=UnitTest.summary, # summaryf=UnitTest.summary,
# ) # )
TestCase(
"re6stnet",
['unshare', '-Umnr', 'bash', '-c', 'mount -t sysfs sysfs /sys && python -m unittest discover -v'],
cwd="""$${re6stnet:location}/re6st/tests""",
summaryf=UnitTest.summary,
)
[runTestSuite] [runTestSuite]
env.sh = $${slapos-test-runner-nxdtest-environment.sh:rendered} env.sh = $${slapos-test-runner-nxdtest-environment.sh:rendered}
......
...@@ -19,6 +19,9 @@ extends = ...@@ -19,6 +19,9 @@ extends =
../../component/userhosts/buildout.cfg ../../component/userhosts/buildout.cfg
../../component/postgresql/buildout.cfg ../../component/postgresql/buildout.cfg
../../component/psycopg2/buildout.cfg ../../component/psycopg2/buildout.cfg
../../component/nftables/buildout.cfg
../../component/miniupnpd/buildout.cfg
../../component/bridge-utils/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/caucase/buildout.cfg ../../stack/caucase/buildout.cfg
../../stack/nxdtest.cfg ../../stack/nxdtest.cfg
...@@ -111,6 +114,11 @@ setup = ${slapos.rebootstrap-repository:location} ...@@ -111,6 +114,11 @@ setup = ${slapos.rebootstrap-repository:location}
egg = rubygemsrecipe[test] egg = rubygemsrecipe[test]
setup = ${rubygemsrecipe-repository:location} setup = ${rubygemsrecipe-repository:location}
[re6stnet-setup]
<= setup-develop-egg
egg = re6stnet[test]
setup = ${re6stnet-repository:location}
[eggs] [eggs]
<= python-interpreter <= python-interpreter
eggs += eggs +=
...@@ -134,8 +142,10 @@ eggs += ...@@ -134,8 +142,10 @@ eggs +=
${slapos.libnetworkcache-setup:egg} ${slapos.libnetworkcache-setup:egg}
${slapos.rebootstrap-setup:egg} ${slapos.rebootstrap-setup:egg}
${rubygemsrecipe-setup:egg} ${rubygemsrecipe-setup:egg}
${re6stnet-setup:egg}
zope.testing zope.testing
supervisor supervisor
pathlib2
[eggs/scripts] [eggs/scripts]
recipe = zc.recipe.egg recipe = zc.recipe.egg
...@@ -205,6 +215,11 @@ repository = https://lab.nexedi.com/nexedi/slapos.rebootstrap.git ...@@ -205,6 +215,11 @@ repository = https://lab.nexedi.com/nexedi/slapos.rebootstrap.git
<= git-clone-repository <= git-clone-repository
repository = https://lab.nexedi.com/nexedi/rubygemsrecipe.git repository = https://lab.nexedi.com/nexedi/rubygemsrecipe.git
[re6stnet-repository]
<= git-clone-repository
branch=net_test
repository = https://lab.nexedi.com/zf.huang/re6stnet.git
[template] [template]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
...@@ -250,3 +265,8 @@ zope.testing = 4.6.2 ...@@ -250,3 +265,8 @@ zope.testing = 4.6.2
urllib3 = 1.24.1 urllib3 = 1.24.1
pathlib = 1.0.1 pathlib = 1.0.1
psycopg2 = 2.8.6 psycopg2 = 2.8.6
miniupnpc = 1.9
python-passfd = 0.2
python-unshare = 0.2
nemu = 0.3.1
multiping = 1.1.2
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