Skip to content

Commit ab90218

Browse files
committed
Test for /etc/fstab mount
1 parent 922b85c commit ab90218

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/ubuntu.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,61 @@ jobs:
152152
run: udevadm control --reload
153153
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
154154
run: ${{ matrix.task }}
155+
156+
# /etc/fstab tests
157+
fstab-checks:
158+
strategy:
159+
matrix:
160+
include:
161+
- toolchain: 1.77.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
162+
components: cargo
163+
runs-on: ubuntu-22.04
164+
steps:
165+
- uses: actions/checkout@v4
166+
- name: Install dependencies for Ubuntu
167+
run: >
168+
sudo DEBIAN_FRONTEND=noninteractive
169+
apt-get install -y
170+
asciidoc
171+
clang
172+
curl
173+
libblkid-dev
174+
libcryptsetup-dev
175+
libdbus-1-dev
176+
libdevmapper-dev
177+
libsystemd-dev
178+
libudev-dev
179+
make
180+
sudo
181+
systemd
182+
thin-provisioning-tools
183+
udev
184+
xfsprogs
185+
- uses: dtolnay/rust-toolchain@master
186+
with:
187+
components: ${{ matrix.components }}
188+
toolchain: ${{ matrix.toolchain }}
189+
- name: Build stratisd
190+
run: PROFILEDIR=debug make -f Makefile build-all
191+
- name: Install stratisd
192+
run: sudo PROFILEDIR=debug make -f Makefile install
193+
- name: Reload udev
194+
run: sudo udevadm control --reload
195+
- name: Start stratisd
196+
run: sudo systemctl start stratisd
197+
- name: Create loopback device backing file
198+
run: truncate -s 5g img.bin
199+
- name: Create loopback device
200+
run: |
201+
sudo losetup -f img.bin
202+
LOOPBACK=$(losetup -j $HOME/img.bin | awk '{ print $1 }' | sed -e "s/://")
203+
sudo stratis pool create testpool $LOOPBACK
204+
- name: Create Stratis pool
205+
- name: Create Stratis filesystem
206+
run: sudo stratis fs create testpool testfs
207+
- name: Edit /etc/fstab
208+
run: |
209+
POOL_UUID=$(stratis pool list --name testpool | grep UUID | awk '{ print $2 }')
210+
echo "/dev/stratis/testpool/testfs /mnt xfs defaults,x-systemd.requires=stratis-fstab-setup@$POOL_UUID.service,x-systemd.after=stratis-fstab-setup@$POOL_UUID.service 0 0" | sudo tee -a /etc/fstab
211+
- name: Mount filesystem
212+
run: sudo mount /dev/stratis/testpool/testfs

0 commit comments

Comments
 (0)