summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-08-10 18:46:07 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 22:02:05 +0200
commit6bb30c2cbaed955383758c64cf51382dd1978cb9 (patch)
tree156023fc555eda4843d96a708e1e115fddfba927 /tests/lib
parent*: use frr_elevate_privs() (1/2: coccinelle) (diff)
downloadfrr-6bb30c2cbaed955383758c64cf51382dd1978cb9.tar.xz
frr-6bb30c2cbaed955383758c64cf51382dd1978cb9.zip
*: use frr_elevate_privs() (2/2: manual)
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/test_privs.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/lib/test_privs.c b/tests/lib/test_privs.c
index 421c34543..e203da8f6 100644
--- a/tests/lib/test_privs.c
+++ b/tests/lib/test_privs.c
@@ -113,10 +113,9 @@ int main(int argc, char **argv)
((test_privs.current_state() == ZPRIVS_RAISED) ? "Raised" : "Lowered")
printf("%s\n", PRIV_STATE());
- test_privs.change(ZPRIVS_RAISE);
-
- printf("%s\n", PRIV_STATE());
- test_privs.change(ZPRIVS_LOWER);
+ frr_elevate_privs(&test_privs) {
+ printf("%s\n", PRIV_STATE());
+ }
printf("%s\n", PRIV_STATE());
zprivs_get_ids(&ids);
@@ -126,10 +125,9 @@ int main(int argc, char **argv)
/* but these should continue to work... */
printf("%s\n", PRIV_STATE());
- test_privs.change(ZPRIVS_RAISE);
-
- printf("%s\n", PRIV_STATE());
- test_privs.change(ZPRIVS_LOWER);
+ frr_elevate_privs(&test_privs) {
+ printf("%s\n", PRIV_STATE());
+ }
printf("%s\n", PRIV_STATE());
zprivs_get_ids(&ids);