-
Notifications
You must be signed in to change notification settings - Fork 3
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
tests: add bhyveload mock #11
Conversation
984b01a
to
899bf94
Compare
5bc466f
to
da96cf3
Compare
Codecov Report
@@ Coverage Diff @@
## master #11 +/- ##
====================================
Coverage 0% 0%
====================================
Files 3 3
Lines 222 222
====================================
Misses 222 222 Continue to review full report at Codecov.
|
tests/test-mock-bhyveload.c
Outdated
@@ -34,6 +34,9 @@ | |||
#define MiB (size_t) (1024 * 1024) | |||
#define GiB (size_t) (1024 * 1024 * 1024) | |||
|
|||
/* copyin into in the highmem is currently not supported by bhyveload. */ | |||
#define TEST_HIGHMEM_ALLOCATION 0 |
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.
usr.sbin/bhyveload/bhyveload.c:338:
to &= 0x7fffffff;
Looks like highmem copyins go to lowmem, so we disable highmem allocation here.
tests/mock/bhyveload.c
Outdated
strlcpy(path, host_base, PATH_MAX); | ||
if (path[strlen(path) - 1] == '/') | ||
path[strlen(path) - 1] = 0; | ||
strlcat(path, filename, PATH_MAX); |
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.
strlcat and strlcpy are not portable:
mock/bhyveload.c:87:2: warning: implicitly declaring library function 'strlcpy'
with type 'unsigned long (char *, const char *, unsigned long)'
[-Wimplicit-function-declaration]
strlcpy(path, host_base, PATH_MAX);
^
mock/bhyveload.c:87:2: note: include the header <string.h> or explicitly provide
a declaration for 'strlcpy'
mock/bhyveload.c:90:2: warning: implicitly declaring library function 'strlcat'
with type 'unsigned long (char *, const char *, unsigned long)'
[-Wimplicit-function-declaration]
strlcat(path, filename, PATH_MAX);
^
d01a928
to
58aef22
Compare
Implement a mock object implementing most of the callbacks of userboot.so allowing access to the emulated state. Tests for these mock callbacks are implemented.
I'll squash the above commits when merging this issue. |
391fbeb
to
b6fbc96
Compare
Contributes to #1