Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

tests/integration/test_storage.sh#1008

Closed
baude wants to merge 1 commit intoprojectatomic:masterfrom
baude:storage_mounts
Closed

tests/integration/test_storage.sh#1008
baude wants to merge 1 commit intoprojectatomic:masterfrom
baude:storage_mounts

Conversation

@baude
Copy link
Member

@baude baude commented May 18, 2017

Description

Use findmnt to detect mounts.

@ashcrow
Copy link
Contributor

ashcrow commented May 18, 2017

+ '[' TARGET SOURCE FSTYPE OPTIONS /var/mnt /dev/vdb ext4 rw,relatime,seclabel,data=ordered /sysroot/ostree/deploy/centos-atomic-host/var/mnt /dev/vdb ext4 rw,relatime,seclabel,data=ordered ']'
./tests/integration/test_storage.sh: line 38: [: too many arguments
+ wipefs -a /dev/vdb
wipefs: error: /dev/vdb: probing initialization failed: Device or resource busy

@jlebon
Copy link
Contributor

jlebon commented May 18, 2017

So this is interesting. To be helpful, the ephemeral disk that OpenStack attaches already has a filesystem on it. E.g. /dev/vdb is an ext4 partition, which is rather unusual. So maybe what we can do here is, in the YAML, do a umount /dev/vdb. And then in the env stanza export e.g. a TEST_STORAGE_DEV=/dev/vdb env var, which gets picked up in test_storage.sh. That way, local devs can set their own block device there.

And then to make sure that all partitions on the device are unmounted, do something like (untested):

findmnt -o SOURCE | grep "^$TEST_STORAGE_DEV" | xargs umount

@baude baude force-pushed the storage_mounts branch from 7c2774f to 23fcb9e Compare May 18, 2017 17:46
@ashcrow
Copy link
Contributor

ashcrow commented May 18, 2017

Getting closer:

umount: /dev/vdb: not mounted

@baude baude force-pushed the storage_mounts branch from 23fcb9e to d6a14e9 Compare May 18, 2017 18:15
@@ -35,10 +35,13 @@ setup () {
# Perform setup routines here.
copy /etc/sysconfig/docker-storage-setup /etc/sysconfig/docker-storage-setup.atomic-tests-backup
TEST_DEV_1=/dev/vdb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is, this should be defined externally rather than hardcoded. It's not guaranteed to be /dev/vdb on every machine where this test is going to run.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood, we just aren't there quite yet. Because this is a destructive test, it usually is only run under vagrant and here. @jlebon i'm actually wondering that if the device isn't declared as an environment variable, the test should just be skipped as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess that is the point of the destructive env variable

@baude baude force-pushed the storage_mounts branch from d6a14e9 to a215730 Compare May 18, 2017 18:40
# umount $MNT
#fi
findmnt -n $TEST_DEV_1 -o TARGET | xargs umount
#findmnt -o SOURCE | grep "^$TEST_DEV_1" | xargs umount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try something like:

findmnt -o SOURCE | grep "^$TEST_DEV_1" | uniq | xargs -r umount

@baude baude force-pushed the storage_mounts branch from a215730 to 25a2ced Compare May 18, 2017 19:55
@rh-atomic-bot
Copy link

☔ The latest upstream changes (presumably d4fd659) made this pull request unmergeable. Please resolve the merge conflicts.

Use findmnt to detect mounts.
@baude baude force-pushed the storage_mounts branch from 25a2ced to 17dec2d Compare May 18, 2017 20:19
@baude
Copy link
Member Author

baude commented May 18, 2017

@rh-atomic-bot r+ 17dec2d

@rh-atomic-bot
Copy link

⌛ Testing commit 17dec2d with merge b829264...

@rh-atomic-bot
Copy link

☀️ Test successful - status-redhatci
Approved by: baude
Pushing b829264 to master...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants