ShyamsundarR
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Running gluster regression tests within a container This document details how to run regression tests within a container, and more importantly useful when attempting to run the same within different distribution flavors, as machines with these flavors may not be easily available. **NOTE:** All tests do not work within a container with the steps below, there are know hangs that happen in the following tests that are yet to be debugged and resloved. In other words **"your mileage may vary!"** Tests that hang (you have been **warned!**): - ./tests/basic/quota-nfs.t - ./tests/bugs/nfs/bug-1161092-nfs-acls.t ## Setup docker On a fresh Fedora (26 is what was used), run the following to setup docker: ``` #dnf install docker #mkdir /d/docker #rmdir /var/lib/docker/ #ln -s /d/docker /var/lib/docker #vi /etc/sysconfig/docker - Remove selinux enforcement for things to work right! #systemctl enable docker #systemctl start docker #docker run hello-world ``` The above does a few specific things that may not be needed for other installations, these (and reasons for the same) are detailed below, - /var/lib/docker is soft linked to a different directory (in the case above /d/docker) - This is done, so that all docker images and work do not use up space in the root partition (which is where /var/lib was in this case), and hence before even starting docker, this was soft linked to another directory on another partition. - Disable SELinux - This was done as it was not needed for the tests, and also further options to make things work when docker selinux enforcement was on, was not investigated - So, if we can keep SELinux and still make things work later, changes to this text would be helpful - docker was enabled to run as a service on restarts - Again this is optional, if dealing with an assigned machine, where everything has to be setup from scratch anyways ## Prepare base images and networks **NOTE:** CentOS7 is used as an example below, for other flavors, use the appropriate base image ``` #docker pull centos OR #docker pull centos:7 ``` **NOTE:** We work with centos in the examples below. As of this writing centos is the same as centos:7 ``` #docker network create --gateway=172.20.0.1 --subnet=172.20.0.0/16 glfstest20 ``` Explanation of the above command: - create a new bridged network for use, names glfstest20 - --subnet for this network - --gateway for this network **NOTE:** This is not essential, but working on a separate bridged network can help isolating other containers using the default bridge, further this bridge can be configured with DNS in the future (see notes on editing /etc/hosts file) ## Preparing the container **NOTE:** CentOS7 is used as an example below, for other flavors, use the appropriate base image ### Getting the base container ready for use ``` #docker run --name=centos-glfs-server1 --hostname=centos-glfs-server1 --volume=/dev:/dev --volume=/d/docker-binds/glfs-node-1:/d: --volume=/root/glusterfs:/root/glusterfs: --volume=/root/build:/root/build: -dti --net glfstest20 --privileged=true --cpuset-cpus 3 centos ``` Explanation of the above command: - --name is used as it is helpful in dealing with determining which container we are working with in `docker container ps` output - --hostname is used as this is leveraged when creating volumes, and mounting them, instead of relying on static IPs in this configuration - --volume is used to preserve the bricks across container restarts, this helps in case we expand the test cases to include things like upgrades, or down server cases - **NOTE:** /d/docker-binds/glfs-node-1 is a local path on the container host, bind mounted into the container as /d (just so we can use our .t files in the future that depends on /d/backends to be present) - -dti creates the container detached (runs in the background), preserves the TTY and also STDIN - --net uses the bridged network that we created - --priveleged is used to be able to read/write xattrs to the bind mounted file system, as gluster bricks need this and a volume creation will fail if xattr support is not present on the brick directories - cpuset-cpus is used to see how best things perform on low CPU counts - /dev is bind mounted to give tests ability to create the loop devices (for snapshot related tests in particular, possibly among others) - /root/glusterfs is the git clone on the host that is again bind mounted within the container to enable compile..install..test ### Prepare LVM to work within the container ```#docker exec -it $(docker ps -qf "name=centos-glfs-server1") sed -i 's/udev_sync\s*=\s*1/udev_sync = 0/' /etc/lvm/lvm.conf``` ```#docker exec -it $(docker ps -qf "name=centos-glfs-server1") sed -i 's/udev_rules\s*=\s*1/udev_rules = 0/' /etc/lvm/lvm.conf``` ```#docker exec -it $(docker ps -qf "name=centos-glfs-server1") sed -i 's/use_lvmetad\s*=\s*1/use_lvmetad = 0/' /etc/lvm/lvm.conf``` ```#modprobe dm_thin_pool``` ### Run it! and enter the container ``` #docker exec -it $(docker ps -qf "name=centos-glfs-server1") bash ``` Explanation of the above command: - docker ps command gets us the container ID of the container that we just created - docker exec ... bash, gets us into a bash shell on that container to run further commands **THOUGHT:** When we get into automation, we possibly will not use -it or run bash, but can pass in a bash script to run the rest of the commands ### Steps within the container shell ```#yum -y update``` ```#yum -y install epel-release``` ```#yum -y install git autoconf automake bison dos2unix flex fuse-devel glib2-devel libaio-devel libattr-devel libibverbs-devel librdmacm-devel libtool libxml2-devel lvm2-devel make openssl-devel pkgconfig pyliblzma python-devel python-eventlet python-netifaces python-paste-deploy python-simplejson python-sphinx python-webob pyxattr readline-devel rpm-build systemtap-sdt-devel tar userspace-rcu-devel libcmocka-devel libacl-devel sqlite-devel dbench nfs-utils json_verify xfsprogs attr yajl which psmisc bc e2fsprogs.x86_64 openssl``` ### Compile, install gluster ```#cd /root/glusterfs/``` ```#./autogen.sh``` ```#cd ../build/``` NOTE: We build inside a different directory, helps throw the build away once we are done with the container, and keeps code directory cleaner ```#../glusterfs/configure --enable-gnfs``` ```#make -j``` ```#make install``` ### Get relevant services started ```#/sbin/rpcbind``` <more?> ### Run the test of choice (or all) ```#cd ../glusterfs/``` ```#./run-tests.sh ./tests/bugs/posix/disallow-gfid-volumeid-fremovexattr.t ``` ## Cleaning up the container These are done post the client container is prepared and the tests are completed, but left here as they are a part of the server/brick container workflow. ``` ** exit the bash shell (if you were in it) - docker stop $(docker ps -qf "name=centos-glfs-server1") - docker rm $(docker ps -qaf "name=centos-glfs-server1") - (cleanup host persistent mount space) - rm -rf /d/docker-binds/glfs-node-1/* ```

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully