summaryrefslogtreecommitdiffhomepage
path: root/test/test_static_symlink.py
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2021-09-30 22:17:28 +0800
committerZhidao HONG <z.hong@f5.com>2021-09-30 22:17:28 +0800
commitc5220944d2acdb912c129fc82ac8a83d24e9845d (patch)
tree8cea32d295c7bde273cfe3a14b6044463aaec155 /test/test_static_symlink.py
parent37144d68499217d086c26a2030e6e9f6f7342152 (diff)
downloadunit-c5220944d2acdb912c129fc82ac8a83d24e9845d.tar.gz
unit-c5220944d2acdb912c129fc82ac8a83d24e9845d.tar.bz2
Static: variables in the "share" option.
This commit supports variable in the "share" option, the finding path to file serve is the value from "share". An example: { "share": "/www/data/static$uri" }
Diffstat (limited to 'test/test_static_symlink.py')
-rw-r--r--test/test_static_symlink.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_static_symlink.py b/test/test_static_symlink.py
index 35eb402a..e0fd7277 100644
--- a/test/test_static_symlink.py
+++ b/test/test_static_symlink.py
@@ -18,7 +18,7 @@ class TestStaticSymlink(TestApplicationProto):
self._load_conf(
{
"listeners": {"*:7080": {"pass": "routes"}},
- "routes": [{"action": {"share": temp_dir + "/assets"}}],
+ "routes": [{"action": {"share": temp_dir + "/assets$uri"}}],
}
)
@@ -33,14 +33,14 @@ class TestStaticSymlink(TestApplicationProto):
assert self.get(url='/link/file')['status'] == 200, 'symlink file'
assert 'success' in self.conf(
- {"share": temp_dir + "/assets", "follow_symlinks": False},
+ {"share": temp_dir + "/assets$uri", "follow_symlinks": False},
'routes/0/action',
), 'configure symlink disable'
assert self.get(url='/link/file')['status'] == 403, 'symlink disabled'
assert 'success' in self.conf(
- {"share": temp_dir + "/assets", "follow_symlinks": True},
+ {"share": temp_dir + "/assets$uri", "follow_symlinks": True},
'routes/0/action',
), 'configure symlink enable'
@@ -56,14 +56,14 @@ class TestStaticSymlink(TestApplicationProto):
{
"match": {"method": "HEAD"},
"action": {
- "share": temp_dir + "/assets",
+ "share": temp_dir + "/assets$uri",
"follow_symlinks": False,
},
},
{
"match": {"method": "GET"},
"action": {
- "share": temp_dir + "/assets",
+ "share": temp_dir + "/assets$uri",
"follow_symlinks": True,
},
},
@@ -85,7 +85,7 @@ class TestStaticSymlink(TestApplicationProto):
assert 'success' in self.conf(
{
- "share": temp_dir + "/assets",
+ "share": temp_dir + "/assets$uri",
"chroot": temp_dir + "/assets/dir/dir",
},
'routes/0/action',