Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libvirt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Libvirt Packaging Team
libvirt
Commits
e89c0593
Commit
e89c0593
authored
9 years ago
by
Guido Günther
Browse files
Options
Downloads
Patches
Plain Diff
test: qemuxml2argv: Mock virMemoryMaxValue to remove 32/64 bit difference
to fix the testsuite on i386
parent
9f29e587
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
debian/patches/test-qemuxml2argv-Mock-virMemoryMaxValue-to-remove-32-64-.patch
+48
-0
48 additions, 0 deletions
...emuxml2argv-Mock-virMemoryMaxValue-to-remove-32-64-.patch
with
49 additions
and
0 deletions
debian/patches/series
+
1
−
0
View file @
e89c0593
...
...
@@ -14,3 +14,4 @@ Allow-access-to-libnl-3-config-files.patch
debian/apparmor_profiles_local_include.patch
debian/libsystemd.patch
CVE-2015-5313-storage-don-t-allow-in-filesystem-volume-na.patch
test-qemuxml2argv-Mock-virMemoryMaxValue-to-remove-32-64-.patch
This diff is collapsed.
Click to expand it.
debian/patches/test-qemuxml2argv-Mock-virMemoryMaxValue-to-remove-32-64-.patch
0 → 100644
+
48
−
0
View file @
e89c0593
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 10 Dec 2015 14:36:51 +0100
Subject: test: qemuxml2argv: Mock virMemoryMaxValue to remove 32/64 bit
difference
Always return LLONG_MAX even on 32 bit systems. The limitation
originates from our use of "unsigned long" in several APIs. The internal
data type is unsigned long long. Make the test suite deterministic by
removing the architecture difference.
Flaw was introduced in 645881139b3d2c86acf9d644c3a1471520bc9e57 where
I've added a test that uses too large numbers.
---
src/util/virutil.c | 2 ++
tests/qemuxml2argvmock.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/src/util/virutil.c b/src/util/virutil.c
index d8e83ef..8f83dcf 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -2639,6 +2639,8 @@
virMemoryLimitIsSet(unsigned long long value)
* @capped: whether the value must fit into unsigned long
* (long long is assumed otherwise)
*
+ * Note: This function is mocked in tests/qemuxml2argvmock.c for test stability
+ *
* Returns the maximum possible memory value in bytes.
*/
unsigned long long
diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
index e58b8ce..8426108 100644
--- a/tests/qemuxml2argvmock.c
+++ b/tests/qemuxml2argvmock.c
@@ -74,3 +74,13 @@
virTPMCreateCancelPath(const char *devpath)
return path;
}
+
+/**
+ * Large values for memory would fail on 32 bit systems, despite having
+ * variables that support it.
+ */
+unsigned long long
+virMemoryMaxValue(bool capped ATTRIBUTE_UNUSED)
+{
+ return LLONG_MAX;
+}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment