Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 938923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:42:36+00:00 2026-05-15T21:42:36+00:00

How do you unit/integration test code that requires a different privilege level than exists

  • 0

How do you unit/integration test code that requires a different privilege level than exists in your continuous integration environment?

In my non-root, CCRB-driven build environment, I’ve got some utility functions that assume privileges that don’t hold in my automated build environment: either root privileges or special accounts and groups. (For example, one function changes UID/GID and supplementary groups to a specified account, changes root and current working directory, and divorces from any controlling terminal.)

We could run the tests by hand, of course, but then we might forget to run them.

How have others tackled this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:42:37+00:00Added an answer on May 15, 2026 at 9:42 pm

    I would try to factor out the security management code behind a mockable interface, so that in unit tests I can provide fake privileges however I want.

    This way it would be possible to test both that barring the required privileges the function fails, and that with the privileges granted it does what it is supposed to do.

    Without more concrete details it is hard to say more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In some unit/integration tests of the code we wish to check that correct usage
I want to create a unit test for integration testing. What class should I
We are migrating our test report data (unit, regression, integration, etc..) from an XML
I have a set of Visual Studio Team System unit (integration really) tests that
I don't know how you guys test your code every time you code a
My question is about test files by which I mean non-code files on which
How can we make an acceptance/integration test on a feature that depends on date
Here's an integration test I wrote for a class that interacts with a database:
I want to unit test the code below. I've been working with MSTest and
In running my VS2008 unit integration tests against my DAL, I have found that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.