Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass uid_mapping test #255

Closed
yihuaf opened this issue Aug 31, 2021 · 9 comments
Closed

Pass uid_mapping test #255

yihuaf opened this issue Aug 31, 2021 · 9 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@yihuaf
Copy link
Collaborator

yihuaf commented Aug 31, 2021

Overview

uid_mapping integration test currently fails. However, all the failure seems to be related to mount device having the wrong type, not related to uid_mapping itself.

Goal

Pass the uid_mapping integration test in runtime-tools.
If you comment in this part and the test passes, you are all set.
https://github.com/containers/youki/blob/ef4b7932e80a91c67503325a76d322f0fc8f670b/integration_test.sh#L53

@yihuaf yihuaf added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 31, 2021
@tommady
Copy link
Collaborator

tommady commented Sep 10, 2021

Hi, I am a newbie of container runtime and wanna do some practice, is it suitable for me to take this issue for practicing? 🙇🏻

@yihuaf
Copy link
Collaborator Author

yihuaf commented Sep 10, 2021

Hi, I am a newbie of container runtime and wanna do some practice, is it suitable for me to take this issue for practicing? 🙇🏻

This is may involve some work and time, but I would encourage you to give it a try. I would suggest you first to read the diagram we have in the README and the src/container/builder_impl.rs and src/process/init.rs to get a sense of how a container is created. After that, run to run the integration test locally and see the failure and logs. ./integration_test.sh uid_mapping after you uncomment the uid_mapping test. From that point, you can make change to code and experiment fixes.

If you need any help, please let us know here or on discord.

@tommady
Copy link
Collaborator

tommady commented Sep 10, 2021

hi @yihuaf,
I just did what you guided me to from the current main branch:

  1. uncomment the "linux_uid_mappings/linux_uid_mappings.t" at integration_test.sh:53
  2. run ./integration_test.sh uid_mapping

and the result that comes out to me is like below

ok 253 # SKIP syscall action SCMP_ACT_ALLOW                                                                 [0/1766]
ok 254 # SKIP syscall action SCMP_ACT_ALLOW
ok 255 # SKIP syscall action SCMP_ACT_ALLOW
ok 256 # SKIP syscall action SCMP_ACT_ALLOW
ok 257 # SKIP linux.readonlyPaths not set
ok 258 # SKIP linux.rootfsPropagation not set
ok 259 # SKIP linux.sysctl not set
ok 260 - /proc/self/uid_map has expected number of mappings
  ---
  {
    "actual": [
      {
        "containerID": 0,
        "hostID": 1000,
        "size": 2000
      }
    ],
    "expected": [
      {
        "containerID": 0,
        "hostID": 1000,
        "size": 2000
      }
    ]
  }
  ...
ok 261 - /proc/self/uid_map has expected mapping {0 1000 2000}
ok 262 - /proc/self/gid_map has expected number of mappings
  ---
  {
    "actual": [
      {
        "containerID": 0,
        "hostID": 1000,
        "size": 3000
      }
    ],
    "expected": [
      {
        "containerID": 0,
        "hostID": 1000,
        "size": 3000
      }
    ]
  }
  ...
ok 263 - /proc/self/gid_map has expected mapping {0 1000 3000}
ok 264 # SKIP linux.mountlabel not set
ok 265 # SKIP process.ApparmorProfile not set
1..265

I am not sure if this means the test passed from my local❓
please guide me if I did something wrong.

thank you

@yihuaf
Copy link
Collaborator Author

yihuaf commented Sep 10, 2021

Did you check all of the tests? It is a long list lol.

It is possible some changes went in that fixed the test. As mentioned, the test was failing for some other reason, not directly uid mapping related. If so, please create a PR and see if CI also passes.

@tommady
Copy link
Collaborator

tommady commented Sep 10, 2021

sorry to make you confused...
ya, there has six not ok cases,
thank you for the guidance.

@yihuaf
Copy link
Collaborator Author

yihuaf commented Sep 10, 2021

Yes, that looks like what we observed earlier. Let us know if you are stuck.

@utam0k
Copy link
Member

utam0k commented Sep 11, 2021

Special thanks @tommady

@utam0k utam0k closed this as completed Sep 11, 2021
@yihuaf yihuaf reopened this Sep 12, 2021
@yihuaf
Copy link
Collaborator Author

yihuaf commented Sep 12, 2021

@utam0k I don't think this issue if fixed yet. I think @tommady was confused since the output list is very long and he missed the not ok, 6 out of 265.

@tommady Do you still want to work on this?

@yihuaf
Copy link
Collaborator Author

yihuaf commented Sep 12, 2021

Ignore what I said: fixed by #289

@yihuaf yihuaf closed this as completed Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants