Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154266473
D52177.id161030.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52177.id161030.diff
View Options
diff --git a/lib/libc/tests/stdtime/detect_tz_changes_test.c b/lib/libc/tests/stdtime/detect_tz_changes_test.c
--- a/lib/libc/tests/stdtime/detect_tz_changes_test.c
+++ b/lib/libc/tests/stdtime/detect_tz_changes_test.c
@@ -322,6 +322,33 @@
test_tz_env(tzcase->tzfn, tzcase->expect);
}
+ATF_TC(thin_jail);
+ATF_TC_HEAD(thin_jail, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test typical thin jail scenario");
+ atf_tc_set_md_var(tc, "require.user", "root");
+}
+ATF_TC_BODY(thin_jail, tc)
+{
+ const struct tzcase *tzcase = tzcases;
+ char buf[128];
+ struct tm *tm;
+ size_t len;
+
+ /* prepare chroot */
+ ATF_REQUIRE_EQ(0, mkdir("root", 0755));
+ ATF_REQUIRE_EQ(0, mkdir("root/etc", 0755));
+ change_tz(tzcase->tzfn);
+ /* enter chroot */
+ ATF_REQUIRE_EQ(0, chroot("root"));
+ ATF_REQUIRE_EQ(0, chdir("/"));
+ /* check timezone */
+ ATF_REQUIRE((tm = localtime(&then)) != NULL);
+ len = strftime(buf, sizeof(buf), "%z (%Z)", tm);
+ ATF_REQUIRE(len > 0);
+ ATF_CHECK_STREQ(tzcase->expect, buf);
+}
+
ATF_TP_ADD_TCS(tp)
{
#ifdef DETECT_TZ_CHANGES
@@ -331,5 +358,6 @@
#endif /* DETECT_TZ_CHANGES */
ATF_TP_ADD_TC(tp, tz_env);
ATF_TP_ADD_TC(tp, tz_env_setugid);
+ ATF_TP_ADD_TC(tp, thin_jail);
return (atf_no_error());
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 28, 12:02 PM (10 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32275789
Default Alt Text
D52177.id161030.diff (1 KB)
Attached To
Mode
D52177: tzcode: Add a test case for thin jails
Attached
Detach File
Event Timeline
Log In to Comment