-
Notifications
You must be signed in to change notification settings - Fork 258
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
Add test for support of NFS mount #1726
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're basically expecting all future LCOW images to have NFS support, right?
execHelper := func(ctrID string, cmd []string) (string, string, int) { | ||
stdout, stderr, errcode := execContainer(t, client, ctx, ctrID, cmd) | ||
if errcode != 0 { | ||
t.Logf("stdout: %s \n\n stderr: %s\n\n", stdout, stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a t.Helper()
call before the t.Logf
call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want the t.Helper()
to be in the errcode block of code or outside of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't matter I think. Either works.
c7557e5
to
26f263e
Compare
Yeah, we just want to ensure that the kernel has the required NFS client modules. If the assumptions changes in the future, we will have to update the test. |
LCOW kernel needs to be built with certain config options(`CONFIG_NFS_FS=y`, `CONFIG_NFS_V4=y` & `CONFIG_NFS_V4_1=y`)_in order to be able to successfully run a NFS client and mount a NFS inside a container. This test attempts to mount a (fake) NFS server to ensure that the kernel has the capabilities of running a NFS client. We don't mount a real NFS server because creating a real NFS server that will work in all kinds of test environments is not simple. Instead, we look at the error returned by the NFS mount operation and decide if the failure is because the server wasn't available (i.e a `Connection refused` error) or because the kernel doesn't support NFS clients (`No Device` error). Limitations on different approaches of starting a real NFS server: 1. Starting another LCOW container that runs a NFS server: By default on Linux the NFS server runs in the kernel and to enable that the kernel must be built with `NFSD_*` config options (note that the config options for running NFS server are different than the config options required for NFS client), which we don't currently do and it doesn't make sense to just enable these options for a test. 2. Running a userspace NFS server: There are a few userspace NFS server projects but getting them to run inside the UtilityVM wasn't very easy. We didn't want to spend a lot of time on this test. 3. Running NFS server on the windows host: Not all builds of windows support this so the test won't run in all environments. Signed-off-by: Amit Barve <ambarve@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
LCOW kernel needs to be built with certain config options(`CONFIG_NFS_FS=y`, `CONFIG_NFS_V4=y` & `CONFIG_NFS_V4_1=y`)_in order to be able to successfully run a NFS client and mount a NFS inside a container. This test attempts to mount a (fake) NFS server to ensure that the kernel has the capabilities of running a NFS client. We don't mount a real NFS server because creating a real NFS server that will work in all kinds of test environments is not simple. Instead, we look at the error returned by the NFS mount operation and decide if the failure is because the server wasn't available (i.e a `Connection refused` error) or because the kernel doesn't support NFS clients (`No Device` error). Limitations on different approaches of starting a real NFS server: 1. Starting another LCOW container that runs a NFS server: By default on Linux the NFS server runs in the kernel and to enable that the kernel must be built with `NFSD_*` config options (note that the config options for running NFS server are different than the config options required for NFS client), which we don't currently do and it doesn't make sense to just enable these options for a test. 2. Running a userspace NFS server: There are a few userspace NFS server projects but getting them to run inside the UtilityVM wasn't very easy. We didn't want to spend a lot of time on this test. 3. Running NFS server on the windows host: Not all builds of windows support this so the test won't run in all environments. Signed-off-by: Amit Barve <ambarve@microsoft.com> (cherry picked from commit e322ac5) Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
LCOW kernel needs to be built with certain config options(`CONFIG_NFS_FS=y`, `CONFIG_NFS_V4=y` & `CONFIG_NFS_V4_1=y`)_in order to be able to successfully run a NFS client and mount a NFS inside a container. This test attempts to mount a (fake) NFS server to ensure that the kernel has the capabilities of running a NFS client. We don't mount a real NFS server because creating a real NFS server that will work in all kinds of test environments is not simple. Instead, we look at the error returned by the NFS mount operation and decide if the failure is because the server wasn't available (i.e a `Connection refused` error) or because the kernel doesn't support NFS clients (`No Device` error). Limitations on different approaches of starting a real NFS server: 1. Starting another LCOW container that runs a NFS server: By default on Linux the NFS server runs in the kernel and to enable that the kernel must be built with `NFSD_*` config options (note that the config options for running NFS server are different than the config options required for NFS client), which we don't currently do and it doesn't make sense to just enable these options for a test. 2. Running a userspace NFS server: There are a few userspace NFS server projects but getting them to run inside the UtilityVM wasn't very easy. We didn't want to spend a lot of time on this test. 3. Running NFS server on the windows host: Not all builds of windows support this so the test won't run in all environments. Signed-off-by: Amit Barve <ambarve@microsoft.com> (cherry picked from commit e322ac5) Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
LCOW kernel needs to be built with certain config options(`CONFIG_NFS_FS=y`, `CONFIG_NFS_V4=y` & `CONFIG_NFS_V4_1=y`)_in order to be able to successfully run a NFS client and mount a NFS inside a container. This test attempts to mount a (fake) NFS server to ensure that the kernel has the capabilities of running a NFS client. We don't mount a real NFS server because creating a real NFS server that will work in all kinds of test environments is not simple. Instead, we look at the error returned by the NFS mount operation and decide if the failure is because the server wasn't available (i.e a `Connection refused` error) or because the kernel doesn't support NFS clients (`No Device` error). Limitations on different approaches of starting a real NFS server: 1. Starting another LCOW container that runs a NFS server: By default on Linux the NFS server runs in the kernel and to enable that the kernel must be built with `NFSD_*` config options (note that the config options for running NFS server are different than the config options required for NFS client), which we don't currently do and it doesn't make sense to just enable these options for a test. 2. Running a userspace NFS server: There are a few userspace NFS server projects but getting them to run inside the UtilityVM wasn't very easy. We didn't want to spend a lot of time on this test. 3. Running NFS server on the windows host: Not all builds of windows support this so the test won't run in all environments. Signed-off-by: Amit Barve <ambarve@microsoft.com> (cherry picked from commit e322ac5) Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
LCOW kernel needs to be built with certain config options(
CONFIG_NFS_FS=y
,CONFIG_NFS_V4=y
&CONFIG_NFS_V4_1=y
)_in order to be able to successfully run a NFS client and mount a NFS inside a container. This test attempts to mount a (fake) NFS server to ensure that the kernel has the capabilities of running a NFS client.We don't mount a real NFS server because creating a real NFS server that will work in all kinds of test environments is not simple. Instead, we look at the error returned by the NFS mount operation and decide if the failure is because the server wasn't available (i.e a
Connection refused
error) or because the kernel doesn't support NFS clients (No Device
error).Limitations on different approaches of starting a real NFS server:
NFSD_*
config options (note that the config options for running NFS server are different than the config options required for NFS client), which we don't currently do and it doesn't make sense to just enable these options for a test.