test: attempt to reproduce issue from #39 - #41

Draft
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro
Draft

test: attempt to reproduce issue from #39#41
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro

Conversation

@mikemccracken

@mikemccrackenmikemccracken commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

see #39

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.35%. Comparing base (528a53f) to head (f29d9b7).

Additional details and impacted files
@@ Coverage Diff @@## main #41 +/- ##
==========================================
- Coverage 38.71% 38.35% -0.36% 
==========================================
Files 24 24 Lines 2255 2255 ==========================================
- Hits 873 865 -8 - Misses 1207 1212 +5 - Partials 175 178 +3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemccracken
mikemccrackenforce-pushed the 2025.04.24/main/attempt-mount-umount-mount-repro branch from f9d96da to f29d9b7CompareApril 24, 2025 22:46
@hallyn

Copy link
Copy Markdown
Contributor

I slightly tweaked your test and put it in its own file test/priv-mount-meta.bats:

load helpers
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
function setup_file() {
check_root
build_image_at $BATS_SUITE_TMPDIR
export MY_MNTNSNAME=$(readlink /proc/self/ns/mnt | cut -c 6-15)
}
function setup() {
export MP=${BATS_TEST_TMPDIR}/testmountpoint
mkdir -p $MP
}
@test "RO mount/umount/remount/umount of good image works" {
echo "MP is $MP" >&3
env >&3
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
echo "after first mount:" >&3
find $MP >&3
run atomfs-cover --debug umount $MP
assert_success
# mount point and meta dir should exist but be empty:
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
echo "after umount:" >&3
find $MP >&3
# rinse, repeat:
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
echo "after second mount:" >&3
find $MP >&3
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
run atomfs-cover --debug umount $MP
assert_success
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
}

And this test does in fact fail:

root@atomfs:/home/ubuntu/atomfs# cd test
root@atomfs:/home/ubuntu/atomfs/test# bats priv-mount-meta.bats
priv-mount-meta.bats
RO mount/umount/remount/umount of good image works 1/1
MP is /tmp/bats-run-xKU0cN/test/1/testmountpoint
SHELL=/bin/bash
BATS_TEST_TMPDIR=/tmp/bats-run-xKU0cN/test/1
SUDO_GID=1000
MY_MNTNSNAME=4026531841
MP=/tmp/bats-run-xKU0cN/test/1/testmountpoint
BATS_SUITE_TMPDIR=/tmp/bats-run-xKU0cN/suite
BATS_ROOT_PID=30770
BATS_WARNING_FILE=/tmp/bats-run-xKU0cN/warnings.log
BATS_FILE_TMPDIR=/tmp/bats-run-xKU0cN/file/0
BATS_END_CODE_QUOTE='
SUDO_COMMAND=/usr/bin/bash
SUDO_USER=ubuntu
BATS_TEST_SOURCE=/tmp/bats-run-xKU0cN/bats.30793.src
BATS_TEST_NAME=test_RO_mount-2fumount-2fremount-2fumount_of_good_image_works
PWD=/tmp/bats-run-xKU0cN/suite
LOGNAME=root
BATS_TMPDIR=/tmp
HOME=/root
LANG=en_US.UTF-8
BATS_TEST_FILENAME=/home/ubuntu/atomfs/test/priv-mount-meta.bats
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wm ✗ RO mount/umount/remount/umount of good image works v=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
BATS_RUN_TMPDIR=/tmp/bats-run-xKU0cN
BATS_VERSION=1.10.0
BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
BATS_CWD=/home/ubuntu/atomfs/test
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=tmux-256color
BATS_LINE_REFERENCE_FORMAT=comma_line
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
BATS_BEGIN_CODE_QUOTE=`
BATS_TEMPDIR_CLEANUP=1
SHLVL=4
BATS_TEST_FILTER=
BATS_TEST_RETRIES=0
BATS_RUNLOG_FILE=/dev/null
BATS_TEST_NUMBER=1
PATH=/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/usr/libexec/bats-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
BATS_LIB_PATH=/usr/lib/bats
BATS_LIBEXEC=/usr/libexec/bats-core
BATS_SUITE_TEST_NUMBER=1
BATS_ROOT=/usr
OLDPWD=/home/ubuntu/atomfs/test
BATS_SAVED_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BASH_FUNC_bats_readlinkf%%=() { readlink -f "$1"
}
_=/usr/bin/env
after first mount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
/tmp/bats-run-xKU0cN/test/1/testmountpoint/1.README.md
/tmp/bats-run-xKU0cN/test/1/testmountpoint/random.txt
after umount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
(from function `assert_success' in file test_helper/bats-assert/src/assert_success.bash, line 45,
in test file priv-mount-meta.bats, line 39)
`assert_success' failed
-- command failed --
status : 1
output (20 lines):
warning: GOCOVERDIR not set, no coverage data emitted
2025/07/04 21:53:54 debug -> ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug <- ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug casext.ResolveReference(test-squashfs) got these descriptors refs=[{[{application/vnd.oci.image.manifest.v1+json sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0 1150 [] map[org.opencontainers.image.ref.name:test-squashfs] [] <nil> }]}]
Error: "/run/atomfs/meta/4026531841/tmp-bats-run-xKU0cN-test-1-testmountpoint" exists: cowardly refusing to mess with it
couldn't mount molecule at mntpt "/tmp/bats-run-xKU0cN/test/1/testmountpoint"
main.doMount
/home/ubuntu/atomfs/cmd/atomfs/mount.go:113
github.com/urfave/cli.HandleAction
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524
github.com/urfave/cli.Command.Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175
github.com/urfave/cli.(*App).Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277
main.main
/home/ubuntu/atomfs/cmd/atomfs/main.go:38
runtime.main
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:272
runtime.goexit
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700
--
1 test, 1 failure
root@atomfs:/home/ubuntu/atomfs/test#
exit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikemccracken@hallyn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

test: attempt to reproduce issue from #39 - #41

Draft
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro
Draft

test: attempt to reproduce issue from #39#41
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro

Conversation

@mikemccracken

@mikemccrackenmikemccracken commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

see #39

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.35%. Comparing base (528a53f) to head (f29d9b7).

Additional details and impacted files
@@ Coverage Diff @@## main #41 +/- ##
==========================================
- Coverage 38.71% 38.35% -0.36% 
==========================================
Files 24 24 Lines 2255 2255 ==========================================
- Hits 873 865 -8 - Misses 1207 1212 +5 - Partials 175 178 +3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemccracken
mikemccrackenforce-pushed the 2025.04.24/main/attempt-mount-umount-mount-repro branch from f9d96da to f29d9b7CompareApril 24, 2025 22:46
@hallyn

Copy link
Copy Markdown
Contributor

I slightly tweaked your test and put it in its own file test/priv-mount-meta.bats:

load helpers
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
function setup_file() {
check_root
build_image_at $BATS_SUITE_TMPDIR
export MY_MNTNSNAME=$(readlink /proc/self/ns/mnt | cut -c 6-15)
}
function setup() {
export MP=${BATS_TEST_TMPDIR}/testmountpoint
mkdir -p $MP
}
@test "RO mount/umount/remount/umount of good image works" {
echo "MP is $MP" >&3
env >&3
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
echo "after first mount:" >&3
find $MP >&3
run atomfs-cover --debug umount $MP
assert_success
# mount point and meta dir should exist but be empty:
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
echo "after umount:" >&3
find $MP >&3
# rinse, repeat:
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
echo "after second mount:" >&3
find $MP >&3
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
run atomfs-cover --debug umount $MP
assert_success
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
}

And this test does in fact fail:

root@atomfs:/home/ubuntu/atomfs# cd test
root@atomfs:/home/ubuntu/atomfs/test# bats priv-mount-meta.bats
priv-mount-meta.bats
RO mount/umount/remount/umount of good image works 1/1
MP is /tmp/bats-run-xKU0cN/test/1/testmountpoint
SHELL=/bin/bash
BATS_TEST_TMPDIR=/tmp/bats-run-xKU0cN/test/1
SUDO_GID=1000
MY_MNTNSNAME=4026531841
MP=/tmp/bats-run-xKU0cN/test/1/testmountpoint
BATS_SUITE_TMPDIR=/tmp/bats-run-xKU0cN/suite
BATS_ROOT_PID=30770
BATS_WARNING_FILE=/tmp/bats-run-xKU0cN/warnings.log
BATS_FILE_TMPDIR=/tmp/bats-run-xKU0cN/file/0
BATS_END_CODE_QUOTE='
SUDO_COMMAND=/usr/bin/bash
SUDO_USER=ubuntu
BATS_TEST_SOURCE=/tmp/bats-run-xKU0cN/bats.30793.src
BATS_TEST_NAME=test_RO_mount-2fumount-2fremount-2fumount_of_good_image_works
PWD=/tmp/bats-run-xKU0cN/suite
LOGNAME=root
BATS_TMPDIR=/tmp
HOME=/root
LANG=en_US.UTF-8
BATS_TEST_FILENAME=/home/ubuntu/atomfs/test/priv-mount-meta.bats
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wm ✗ RO mount/umount/remount/umount of good image works v=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
BATS_RUN_TMPDIR=/tmp/bats-run-xKU0cN
BATS_VERSION=1.10.0
BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
BATS_CWD=/home/ubuntu/atomfs/test
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=tmux-256color
BATS_LINE_REFERENCE_FORMAT=comma_line
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
BATS_BEGIN_CODE_QUOTE=`
BATS_TEMPDIR_CLEANUP=1
SHLVL=4
BATS_TEST_FILTER=
BATS_TEST_RETRIES=0
BATS_RUNLOG_FILE=/dev/null
BATS_TEST_NUMBER=1
PATH=/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/usr/libexec/bats-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
BATS_LIB_PATH=/usr/lib/bats
BATS_LIBEXEC=/usr/libexec/bats-core
BATS_SUITE_TEST_NUMBER=1
BATS_ROOT=/usr
OLDPWD=/home/ubuntu/atomfs/test
BATS_SAVED_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BASH_FUNC_bats_readlinkf%%=() { readlink -f "$1"
}
_=/usr/bin/env
after first mount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
/tmp/bats-run-xKU0cN/test/1/testmountpoint/1.README.md
/tmp/bats-run-xKU0cN/test/1/testmountpoint/random.txt
after umount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
(from function `assert_success' in file test_helper/bats-assert/src/assert_success.bash, line 45,
in test file priv-mount-meta.bats, line 39)
`assert_success' failed
-- command failed --
status : 1
output (20 lines):
warning: GOCOVERDIR not set, no coverage data emitted
2025/07/04 21:53:54 debug -> ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug <- ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug casext.ResolveReference(test-squashfs) got these descriptors refs=[{[{application/vnd.oci.image.manifest.v1+json sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0 1150 [] map[org.opencontainers.image.ref.name:test-squashfs] [] <nil> }]}]
Error: "/run/atomfs/meta/4026531841/tmp-bats-run-xKU0cN-test-1-testmountpoint" exists: cowardly refusing to mess with it
couldn't mount molecule at mntpt "/tmp/bats-run-xKU0cN/test/1/testmountpoint"
main.doMount
/home/ubuntu/atomfs/cmd/atomfs/mount.go:113
github.com/urfave/cli.HandleAction
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524
github.com/urfave/cli.Command.Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175
github.com/urfave/cli.(*App).Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277
main.main
/home/ubuntu/atomfs/cmd/atomfs/main.go:38
runtime.main
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:272
runtime.goexit
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700
--
1 test, 1 failure
root@atomfs:/home/ubuntu/atomfs/test#
exit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikemccracken@hallyn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test: attempt to reproduce issue from #39 - #41

Draft
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro
Draft

test: attempt to reproduce issue from #39#41
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro

Conversation

@mikemccracken

@mikemccrackenmikemccracken commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

see #39

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.35%. Comparing base (528a53f) to head (f29d9b7).

Additional details and impacted files
@@ Coverage Diff @@## main #41 +/- ##
==========================================
- Coverage 38.71% 38.35% -0.36% 
==========================================
Files 24 24 Lines 2255 2255 ==========================================
- Hits 873 865 -8 - Misses 1207 1212 +5 - Partials 175 178 +3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemccracken
mikemccrackenforce-pushed the 2025.04.24/main/attempt-mount-umount-mount-repro branch from f9d96da to f29d9b7CompareApril 24, 2025 22:46
@hallyn

Copy link
Copy Markdown
Contributor

I slightly tweaked your test and put it in its own file test/priv-mount-meta.bats:

load helpers
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
function setup_file() {
check_root
build_image_at $BATS_SUITE_TMPDIR
export MY_MNTNSNAME=$(readlink /proc/self/ns/mnt | cut -c 6-15)
}
function setup() {
export MP=${BATS_TEST_TMPDIR}/testmountpoint
mkdir -p $MP
}
@test "RO mount/umount/remount/umount of good image works" {
echo "MP is $MP" >&3
env >&3
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
echo "after first mount:" >&3
find $MP >&3
run atomfs-cover --debug umount $MP
assert_success
# mount point and meta dir should exist but be empty:
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
echo "after umount:" >&3
find $MP >&3
# rinse, repeat:
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
echo "after second mount:" >&3
find $MP >&3
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
run atomfs-cover --debug umount $MP
assert_success
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
}

And this test does in fact fail:

root@atomfs:/home/ubuntu/atomfs# cd test
root@atomfs:/home/ubuntu/atomfs/test# bats priv-mount-meta.bats
priv-mount-meta.bats
RO mount/umount/remount/umount of good image works 1/1
MP is /tmp/bats-run-xKU0cN/test/1/testmountpoint
SHELL=/bin/bash
BATS_TEST_TMPDIR=/tmp/bats-run-xKU0cN/test/1
SUDO_GID=1000
MY_MNTNSNAME=4026531841
MP=/tmp/bats-run-xKU0cN/test/1/testmountpoint
BATS_SUITE_TMPDIR=/tmp/bats-run-xKU0cN/suite
BATS_ROOT_PID=30770
BATS_WARNING_FILE=/tmp/bats-run-xKU0cN/warnings.log
BATS_FILE_TMPDIR=/tmp/bats-run-xKU0cN/file/0
BATS_END_CODE_QUOTE='
SUDO_COMMAND=/usr/bin/bash
SUDO_USER=ubuntu
BATS_TEST_SOURCE=/tmp/bats-run-xKU0cN/bats.30793.src
BATS_TEST_NAME=test_RO_mount-2fumount-2fremount-2fumount_of_good_image_works
PWD=/tmp/bats-run-xKU0cN/suite
LOGNAME=root
BATS_TMPDIR=/tmp
HOME=/root
LANG=en_US.UTF-8
BATS_TEST_FILENAME=/home/ubuntu/atomfs/test/priv-mount-meta.bats
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wm ✗ RO mount/umount/remount/umount of good image works v=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
BATS_RUN_TMPDIR=/tmp/bats-run-xKU0cN
BATS_VERSION=1.10.0
BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
BATS_CWD=/home/ubuntu/atomfs/test
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=tmux-256color
BATS_LINE_REFERENCE_FORMAT=comma_line
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
BATS_BEGIN_CODE_QUOTE=`
BATS_TEMPDIR_CLEANUP=1
SHLVL=4
BATS_TEST_FILTER=
BATS_TEST_RETRIES=0
BATS_RUNLOG_FILE=/dev/null
BATS_TEST_NUMBER=1
PATH=/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/usr/libexec/bats-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
BATS_LIB_PATH=/usr/lib/bats
BATS_LIBEXEC=/usr/libexec/bats-core
BATS_SUITE_TEST_NUMBER=1
BATS_ROOT=/usr
OLDPWD=/home/ubuntu/atomfs/test
BATS_SAVED_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BASH_FUNC_bats_readlinkf%%=() { readlink -f "$1"
}
_=/usr/bin/env
after first mount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
/tmp/bats-run-xKU0cN/test/1/testmountpoint/1.README.md
/tmp/bats-run-xKU0cN/test/1/testmountpoint/random.txt
after umount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
(from function `assert_success' in file test_helper/bats-assert/src/assert_success.bash, line 45,
in test file priv-mount-meta.bats, line 39)
`assert_success' failed
-- command failed --
status : 1
output (20 lines):
warning: GOCOVERDIR not set, no coverage data emitted
2025/07/04 21:53:54 debug -> ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug <- ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug casext.ResolveReference(test-squashfs) got these descriptors refs=[{[{application/vnd.oci.image.manifest.v1+json sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0 1150 [] map[org.opencontainers.image.ref.name:test-squashfs] [] <nil> }]}]
Error: "/run/atomfs/meta/4026531841/tmp-bats-run-xKU0cN-test-1-testmountpoint" exists: cowardly refusing to mess with it
couldn't mount molecule at mntpt "/tmp/bats-run-xKU0cN/test/1/testmountpoint"
main.doMount
/home/ubuntu/atomfs/cmd/atomfs/mount.go:113
github.com/urfave/cli.HandleAction
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524
github.com/urfave/cli.Command.Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175
github.com/urfave/cli.(*App).Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277
main.main
/home/ubuntu/atomfs/cmd/atomfs/main.go:38
runtime.main
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:272
runtime.goexit
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700
--
1 test, 1 failure
root@atomfs:/home/ubuntu/atomfs/test#
exit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikemccracken@hallyn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test: attempt to reproduce issue from #39 - #41

Draft
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro
Draft

test: attempt to reproduce issue from #39#41
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro

Conversation

@mikemccracken

@mikemccrackenmikemccracken commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

see #39

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.35%. Comparing base (528a53f) to head (f29d9b7).

Additional details and impacted files
@@ Coverage Diff @@## main #41 +/- ##
==========================================
- Coverage 38.71% 38.35% -0.36% 
==========================================
Files 24 24 Lines 2255 2255 ==========================================
- Hits 873 865 -8 - Misses 1207 1212 +5 - Partials 175 178 +3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemccracken
mikemccrackenforce-pushed the 2025.04.24/main/attempt-mount-umount-mount-repro branch from f9d96da to f29d9b7CompareApril 24, 2025 22:46
@hallyn

Copy link
Copy Markdown
Contributor

I slightly tweaked your test and put it in its own file test/priv-mount-meta.bats:

load helpers
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
function setup_file() {
check_root
build_image_at $BATS_SUITE_TMPDIR
export MY_MNTNSNAME=$(readlink /proc/self/ns/mnt | cut -c 6-15)
}
function setup() {
export MP=${BATS_TEST_TMPDIR}/testmountpoint
mkdir -p $MP
}
@test "RO mount/umount/remount/umount of good image works" {
echo "MP is $MP" >&3
env >&3
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
echo "after first mount:" >&3
find $MP >&3
run atomfs-cover --debug umount $MP
assert_success
# mount point and meta dir should exist but be empty:
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
echo "after umount:" >&3
find $MP >&3
# rinse, repeat:
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
echo "after second mount:" >&3
find $MP >&3
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
run atomfs-cover --debug umount $MP
assert_success
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
}

And this test does in fact fail:

root@atomfs:/home/ubuntu/atomfs# cd test
root@atomfs:/home/ubuntu/atomfs/test# bats priv-mount-meta.bats
priv-mount-meta.bats
RO mount/umount/remount/umount of good image works 1/1
MP is /tmp/bats-run-xKU0cN/test/1/testmountpoint
SHELL=/bin/bash
BATS_TEST_TMPDIR=/tmp/bats-run-xKU0cN/test/1
SUDO_GID=1000
MY_MNTNSNAME=4026531841
MP=/tmp/bats-run-xKU0cN/test/1/testmountpoint
BATS_SUITE_TMPDIR=/tmp/bats-run-xKU0cN/suite
BATS_ROOT_PID=30770
BATS_WARNING_FILE=/tmp/bats-run-xKU0cN/warnings.log
BATS_FILE_TMPDIR=/tmp/bats-run-xKU0cN/file/0
BATS_END_CODE_QUOTE='
SUDO_COMMAND=/usr/bin/bash
SUDO_USER=ubuntu
BATS_TEST_SOURCE=/tmp/bats-run-xKU0cN/bats.30793.src
BATS_TEST_NAME=test_RO_mount-2fumount-2fremount-2fumount_of_good_image_works
PWD=/tmp/bats-run-xKU0cN/suite
LOGNAME=root
BATS_TMPDIR=/tmp
HOME=/root
LANG=en_US.UTF-8
BATS_TEST_FILENAME=/home/ubuntu/atomfs/test/priv-mount-meta.bats
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wm ✗ RO mount/umount/remount/umount of good image works v=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
BATS_RUN_TMPDIR=/tmp/bats-run-xKU0cN
BATS_VERSION=1.10.0
BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
BATS_CWD=/home/ubuntu/atomfs/test
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=tmux-256color
BATS_LINE_REFERENCE_FORMAT=comma_line
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
BATS_BEGIN_CODE_QUOTE=`
BATS_TEMPDIR_CLEANUP=1
SHLVL=4
BATS_TEST_FILTER=
BATS_TEST_RETRIES=0
BATS_RUNLOG_FILE=/dev/null
BATS_TEST_NUMBER=1
PATH=/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/usr/libexec/bats-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
BATS_LIB_PATH=/usr/lib/bats
BATS_LIBEXEC=/usr/libexec/bats-core
BATS_SUITE_TEST_NUMBER=1
BATS_ROOT=/usr
OLDPWD=/home/ubuntu/atomfs/test
BATS_SAVED_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BASH_FUNC_bats_readlinkf%%=() { readlink -f "$1"
}
_=/usr/bin/env
after first mount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
/tmp/bats-run-xKU0cN/test/1/testmountpoint/1.README.md
/tmp/bats-run-xKU0cN/test/1/testmountpoint/random.txt
after umount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
(from function `assert_success' in file test_helper/bats-assert/src/assert_success.bash, line 45,
in test file priv-mount-meta.bats, line 39)
`assert_success' failed
-- command failed --
status : 1
output (20 lines):
warning: GOCOVERDIR not set, no coverage data emitted
2025/07/04 21:53:54 debug -> ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug <- ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug casext.ResolveReference(test-squashfs) got these descriptors refs=[{[{application/vnd.oci.image.manifest.v1+json sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0 1150 [] map[org.opencontainers.image.ref.name:test-squashfs] [] <nil> }]}]
Error: "/run/atomfs/meta/4026531841/tmp-bats-run-xKU0cN-test-1-testmountpoint" exists: cowardly refusing to mess with it
couldn't mount molecule at mntpt "/tmp/bats-run-xKU0cN/test/1/testmountpoint"
main.doMount
/home/ubuntu/atomfs/cmd/atomfs/mount.go:113
github.com/urfave/cli.HandleAction
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524
github.com/urfave/cli.Command.Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175
github.com/urfave/cli.(*App).Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277
main.main
/home/ubuntu/atomfs/cmd/atomfs/main.go:38
runtime.main
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:272
runtime.goexit
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700
--
1 test, 1 failure
root@atomfs:/home/ubuntu/atomfs/test#
exit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikemccracken@hallyn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

test: attempt to reproduce issue from #39 - #41

Draft
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro
Draft

test: attempt to reproduce issue from #39#41
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro

Conversation

@mikemccracken

@mikemccrackenmikemccracken commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

see #39

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.35%. Comparing base (528a53f) to head (f29d9b7).

Additional details and impacted files
@@ Coverage Diff @@## main #41 +/- ##
==========================================
- Coverage 38.71% 38.35% -0.36% 
==========================================
Files 24 24 Lines 2255 2255 ==========================================
- Hits 873 865 -8 - Misses 1207 1212 +5 - Partials 175 178 +3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemccracken
mikemccrackenforce-pushed the 2025.04.24/main/attempt-mount-umount-mount-repro branch from f9d96da to f29d9b7CompareApril 24, 2025 22:46
@hallyn

Copy link
Copy Markdown
Contributor

I slightly tweaked your test and put it in its own file test/priv-mount-meta.bats:

load helpers
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
function setup_file() {
check_root
build_image_at $BATS_SUITE_TMPDIR
export MY_MNTNSNAME=$(readlink /proc/self/ns/mnt | cut -c 6-15)
}
function setup() {
export MP=${BATS_TEST_TMPDIR}/testmountpoint
mkdir -p $MP
}
@test "RO mount/umount/remount/umount of good image works" {
echo "MP is $MP" >&3
env >&3
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
echo "after first mount:" >&3
find $MP >&3
run atomfs-cover --debug umount $MP
assert_success
# mount point and meta dir should exist but be empty:
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
echo "after umount:" >&3
find $MP >&3
# rinse, repeat:
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
echo "after second mount:" >&3
find $MP >&3
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
run atomfs-cover --debug umount $MP
assert_success
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
}

And this test does in fact fail:

root@atomfs:/home/ubuntu/atomfs# cd test
root@atomfs:/home/ubuntu/atomfs/test# bats priv-mount-meta.bats
priv-mount-meta.bats
RO mount/umount/remount/umount of good image works 1/1
MP is /tmp/bats-run-xKU0cN/test/1/testmountpoint
SHELL=/bin/bash
BATS_TEST_TMPDIR=/tmp/bats-run-xKU0cN/test/1
SUDO_GID=1000
MY_MNTNSNAME=4026531841
MP=/tmp/bats-run-xKU0cN/test/1/testmountpoint
BATS_SUITE_TMPDIR=/tmp/bats-run-xKU0cN/suite
BATS_ROOT_PID=30770
BATS_WARNING_FILE=/tmp/bats-run-xKU0cN/warnings.log
BATS_FILE_TMPDIR=/tmp/bats-run-xKU0cN/file/0
BATS_END_CODE_QUOTE='
SUDO_COMMAND=/usr/bin/bash
SUDO_USER=ubuntu
BATS_TEST_SOURCE=/tmp/bats-run-xKU0cN/bats.30793.src
BATS_TEST_NAME=test_RO_mount-2fumount-2fremount-2fumount_of_good_image_works
PWD=/tmp/bats-run-xKU0cN/suite
LOGNAME=root
BATS_TMPDIR=/tmp
HOME=/root
LANG=en_US.UTF-8
BATS_TEST_FILENAME=/home/ubuntu/atomfs/test/priv-mount-meta.bats
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wm ✗ RO mount/umount/remount/umount of good image works v=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
BATS_RUN_TMPDIR=/tmp/bats-run-xKU0cN
BATS_VERSION=1.10.0
BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
BATS_CWD=/home/ubuntu/atomfs/test
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=tmux-256color
BATS_LINE_REFERENCE_FORMAT=comma_line
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
BATS_BEGIN_CODE_QUOTE=`
BATS_TEMPDIR_CLEANUP=1
SHLVL=4
BATS_TEST_FILTER=
BATS_TEST_RETRIES=0
BATS_RUNLOG_FILE=/dev/null
BATS_TEST_NUMBER=1
PATH=/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/usr/libexec/bats-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
BATS_LIB_PATH=/usr/lib/bats
BATS_LIBEXEC=/usr/libexec/bats-core
BATS_SUITE_TEST_NUMBER=1
BATS_ROOT=/usr
OLDPWD=/home/ubuntu/atomfs/test
BATS_SAVED_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BASH_FUNC_bats_readlinkf%%=() { readlink -f "$1"
}
_=/usr/bin/env
after first mount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
/tmp/bats-run-xKU0cN/test/1/testmountpoint/1.README.md
/tmp/bats-run-xKU0cN/test/1/testmountpoint/random.txt
after umount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
(from function `assert_success' in file test_helper/bats-assert/src/assert_success.bash, line 45,
in test file priv-mount-meta.bats, line 39)
`assert_success' failed
-- command failed --
status : 1
output (20 lines):
warning: GOCOVERDIR not set, no coverage data emitted
2025/07/04 21:53:54 debug -> ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug <- ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug casext.ResolveReference(test-squashfs) got these descriptors refs=[{[{application/vnd.oci.image.manifest.v1+json sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0 1150 [] map[org.opencontainers.image.ref.name:test-squashfs] [] <nil> }]}]
Error: "/run/atomfs/meta/4026531841/tmp-bats-run-xKU0cN-test-1-testmountpoint" exists: cowardly refusing to mess with it
couldn't mount molecule at mntpt "/tmp/bats-run-xKU0cN/test/1/testmountpoint"
main.doMount
/home/ubuntu/atomfs/cmd/atomfs/mount.go:113
github.com/urfave/cli.HandleAction
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524
github.com/urfave/cli.Command.Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175
github.com/urfave/cli.(*App).Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277
main.main
/home/ubuntu/atomfs/cmd/atomfs/main.go:38
runtime.main
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:272
runtime.goexit
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700
--
1 test, 1 failure
root@atomfs:/home/ubuntu/atomfs/test#
exit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikemccracken@hallyn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test: attempt to reproduce issue from #39 - #41

Draft
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro
Draft

test: attempt to reproduce issue from #39#41
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro

Conversation

@mikemccracken

@mikemccrackenmikemccracken commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

see #39

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.35%. Comparing base (528a53f) to head (f29d9b7).

Additional details and impacted files
@@ Coverage Diff @@## main #41 +/- ##
==========================================
- Coverage 38.71% 38.35% -0.36% 
==========================================
Files 24 24 Lines 2255 2255 ==========================================
- Hits 873 865 -8 - Misses 1207 1212 +5 - Partials 175 178 +3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemccracken
mikemccrackenforce-pushed the 2025.04.24/main/attempt-mount-umount-mount-repro branch from f9d96da to f29d9b7CompareApril 24, 2025 22:46
@hallyn

Copy link
Copy Markdown
Contributor

I slightly tweaked your test and put it in its own file test/priv-mount-meta.bats:

load helpers
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
function setup_file() {
check_root
build_image_at $BATS_SUITE_TMPDIR
export MY_MNTNSNAME=$(readlink /proc/self/ns/mnt | cut -c 6-15)
}
function setup() {
export MP=${BATS_TEST_TMPDIR}/testmountpoint
mkdir -p $MP
}
@test "RO mount/umount/remount/umount of good image works" {
echo "MP is $MP" >&3
env >&3
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
echo "after first mount:" >&3
find $MP >&3
run atomfs-cover --debug umount $MP
assert_success
# mount point and meta dir should exist but be empty:
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
echo "after umount:" >&3
find $MP >&3
# rinse, repeat:
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
echo "after second mount:" >&3
find $MP >&3
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
run atomfs-cover --debug umount $MP
assert_success
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
}

And this test does in fact fail:

root@atomfs:/home/ubuntu/atomfs# cd test
root@atomfs:/home/ubuntu/atomfs/test# bats priv-mount-meta.bats
priv-mount-meta.bats
RO mount/umount/remount/umount of good image works 1/1
MP is /tmp/bats-run-xKU0cN/test/1/testmountpoint
SHELL=/bin/bash
BATS_TEST_TMPDIR=/tmp/bats-run-xKU0cN/test/1
SUDO_GID=1000
MY_MNTNSNAME=4026531841
MP=/tmp/bats-run-xKU0cN/test/1/testmountpoint
BATS_SUITE_TMPDIR=/tmp/bats-run-xKU0cN/suite
BATS_ROOT_PID=30770
BATS_WARNING_FILE=/tmp/bats-run-xKU0cN/warnings.log
BATS_FILE_TMPDIR=/tmp/bats-run-xKU0cN/file/0
BATS_END_CODE_QUOTE='
SUDO_COMMAND=/usr/bin/bash
SUDO_USER=ubuntu
BATS_TEST_SOURCE=/tmp/bats-run-xKU0cN/bats.30793.src
BATS_TEST_NAME=test_RO_mount-2fumount-2fremount-2fumount_of_good_image_works
PWD=/tmp/bats-run-xKU0cN/suite
LOGNAME=root
BATS_TMPDIR=/tmp
HOME=/root
LANG=en_US.UTF-8
BATS_TEST_FILENAME=/home/ubuntu/atomfs/test/priv-mount-meta.bats
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wm ✗ RO mount/umount/remount/umount of good image works v=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
BATS_RUN_TMPDIR=/tmp/bats-run-xKU0cN
BATS_VERSION=1.10.0
BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
BATS_CWD=/home/ubuntu/atomfs/test
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=tmux-256color
BATS_LINE_REFERENCE_FORMAT=comma_line
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
BATS_BEGIN_CODE_QUOTE=`
BATS_TEMPDIR_CLEANUP=1
SHLVL=4
BATS_TEST_FILTER=
BATS_TEST_RETRIES=0
BATS_RUNLOG_FILE=/dev/null
BATS_TEST_NUMBER=1
PATH=/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/usr/libexec/bats-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
BATS_LIB_PATH=/usr/lib/bats
BATS_LIBEXEC=/usr/libexec/bats-core
BATS_SUITE_TEST_NUMBER=1
BATS_ROOT=/usr
OLDPWD=/home/ubuntu/atomfs/test
BATS_SAVED_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BASH_FUNC_bats_readlinkf%%=() { readlink -f "$1"
}
_=/usr/bin/env
after first mount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
/tmp/bats-run-xKU0cN/test/1/testmountpoint/1.README.md
/tmp/bats-run-xKU0cN/test/1/testmountpoint/random.txt
after umount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
(from function `assert_success' in file test_helper/bats-assert/src/assert_success.bash, line 45,
in test file priv-mount-meta.bats, line 39)
`assert_success' failed
-- command failed --
status : 1
output (20 lines):
warning: GOCOVERDIR not set, no coverage data emitted
2025/07/04 21:53:54 debug -> ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug <- ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug casext.ResolveReference(test-squashfs) got these descriptors refs=[{[{application/vnd.oci.image.manifest.v1+json sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0 1150 [] map[org.opencontainers.image.ref.name:test-squashfs] [] <nil> }]}]
Error: "/run/atomfs/meta/4026531841/tmp-bats-run-xKU0cN-test-1-testmountpoint" exists: cowardly refusing to mess with it
couldn't mount molecule at mntpt "/tmp/bats-run-xKU0cN/test/1/testmountpoint"
main.doMount
/home/ubuntu/atomfs/cmd/atomfs/mount.go:113
github.com/urfave/cli.HandleAction
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524
github.com/urfave/cli.Command.Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175
github.com/urfave/cli.(*App).Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277
main.main
/home/ubuntu/atomfs/cmd/atomfs/main.go:38
runtime.main
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:272
runtime.goexit
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700
--
1 test, 1 failure
root@atomfs:/home/ubuntu/atomfs/test#
exit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikemccracken@hallyn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test: attempt to reproduce issue from #39 - #41

Draft
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro
Draft

test: attempt to reproduce issue from #39#41
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro

Conversation

@mikemccracken

@mikemccrackenmikemccracken commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

see #39

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.35%. Comparing base (528a53f) to head (f29d9b7).

Additional details and impacted files
@@ Coverage Diff @@## main #41 +/- ##
==========================================
- Coverage 38.71% 38.35% -0.36% 
==========================================
Files 24 24 Lines 2255 2255 ==========================================
- Hits 873 865 -8 - Misses 1207 1212 +5 - Partials 175 178 +3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemccracken
mikemccrackenforce-pushed the 2025.04.24/main/attempt-mount-umount-mount-repro branch from f9d96da to f29d9b7CompareApril 24, 2025 22:46
@hallyn

Copy link
Copy Markdown
Contributor

I slightly tweaked your test and put it in its own file test/priv-mount-meta.bats:

load helpers
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
function setup_file() {
check_root
build_image_at $BATS_SUITE_TMPDIR
export MY_MNTNSNAME=$(readlink /proc/self/ns/mnt | cut -c 6-15)
}
function setup() {
export MP=${BATS_TEST_TMPDIR}/testmountpoint
mkdir -p $MP
}
@test "RO mount/umount/remount/umount of good image works" {
echo "MP is $MP" >&3
env >&3
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
echo "after first mount:" >&3
find $MP >&3
run atomfs-cover --debug umount $MP
assert_success
# mount point and meta dir should exist but be empty:
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
echo "after umount:" >&3
find $MP >&3
# rinse, repeat:
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
echo "after second mount:" >&3
find $MP >&3
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
run atomfs-cover --debug umount $MP
assert_success
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
}

And this test does in fact fail:

root@atomfs:/home/ubuntu/atomfs# cd test
root@atomfs:/home/ubuntu/atomfs/test# bats priv-mount-meta.bats
priv-mount-meta.bats
RO mount/umount/remount/umount of good image works 1/1
MP is /tmp/bats-run-xKU0cN/test/1/testmountpoint
SHELL=/bin/bash
BATS_TEST_TMPDIR=/tmp/bats-run-xKU0cN/test/1
SUDO_GID=1000
MY_MNTNSNAME=4026531841
MP=/tmp/bats-run-xKU0cN/test/1/testmountpoint
BATS_SUITE_TMPDIR=/tmp/bats-run-xKU0cN/suite
BATS_ROOT_PID=30770
BATS_WARNING_FILE=/tmp/bats-run-xKU0cN/warnings.log
BATS_FILE_TMPDIR=/tmp/bats-run-xKU0cN/file/0
BATS_END_CODE_QUOTE='
SUDO_COMMAND=/usr/bin/bash
SUDO_USER=ubuntu
BATS_TEST_SOURCE=/tmp/bats-run-xKU0cN/bats.30793.src
BATS_TEST_NAME=test_RO_mount-2fumount-2fremount-2fumount_of_good_image_works
PWD=/tmp/bats-run-xKU0cN/suite
LOGNAME=root
BATS_TMPDIR=/tmp
HOME=/root
LANG=en_US.UTF-8
BATS_TEST_FILENAME=/home/ubuntu/atomfs/test/priv-mount-meta.bats
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wm ✗ RO mount/umount/remount/umount of good image works v=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
BATS_RUN_TMPDIR=/tmp/bats-run-xKU0cN
BATS_VERSION=1.10.0
BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
BATS_CWD=/home/ubuntu/atomfs/test
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=tmux-256color
BATS_LINE_REFERENCE_FORMAT=comma_line
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
BATS_BEGIN_CODE_QUOTE=`
BATS_TEMPDIR_CLEANUP=1
SHLVL=4
BATS_TEST_FILTER=
BATS_TEST_RETRIES=0
BATS_RUNLOG_FILE=/dev/null
BATS_TEST_NUMBER=1
PATH=/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/usr/libexec/bats-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
BATS_LIB_PATH=/usr/lib/bats
BATS_LIBEXEC=/usr/libexec/bats-core
BATS_SUITE_TEST_NUMBER=1
BATS_ROOT=/usr
OLDPWD=/home/ubuntu/atomfs/test
BATS_SAVED_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BASH_FUNC_bats_readlinkf%%=() { readlink -f "$1"
}
_=/usr/bin/env
after first mount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
/tmp/bats-run-xKU0cN/test/1/testmountpoint/1.README.md
/tmp/bats-run-xKU0cN/test/1/testmountpoint/random.txt
after umount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
(from function `assert_success' in file test_helper/bats-assert/src/assert_success.bash, line 45,
in test file priv-mount-meta.bats, line 39)
`assert_success' failed
-- command failed --
status : 1
output (20 lines):
warning: GOCOVERDIR not set, no coverage data emitted
2025/07/04 21:53:54 debug -> ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug <- ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug casext.ResolveReference(test-squashfs) got these descriptors refs=[{[{application/vnd.oci.image.manifest.v1+json sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0 1150 [] map[org.opencontainers.image.ref.name:test-squashfs] [] <nil> }]}]
Error: "/run/atomfs/meta/4026531841/tmp-bats-run-xKU0cN-test-1-testmountpoint" exists: cowardly refusing to mess with it
couldn't mount molecule at mntpt "/tmp/bats-run-xKU0cN/test/1/testmountpoint"
main.doMount
/home/ubuntu/atomfs/cmd/atomfs/mount.go:113
github.com/urfave/cli.HandleAction
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524
github.com/urfave/cli.Command.Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175
github.com/urfave/cli.(*App).Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277
main.main
/home/ubuntu/atomfs/cmd/atomfs/main.go:38
runtime.main
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:272
runtime.goexit
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700
--
1 test, 1 failure
root@atomfs:/home/ubuntu/atomfs/test#
exit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikemccracken@hallyn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

test: attempt to reproduce issue from #39 - #41

Draft
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro
Draft

test: attempt to reproduce issue from #39#41
mikemccracken wants to merge 1 commit into
project-machine:mainfrom
mikemccracken:2025.04.24/main/attempt-mount-umount-mount-repro

Conversation

@mikemccracken

@mikemccrackenmikemccracken commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

see #39

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.35%. Comparing base (528a53f) to head (f29d9b7).

Additional details and impacted files
@@ Coverage Diff @@## main #41 +/- ##
==========================================
- Coverage 38.71% 38.35% -0.36% 
==========================================
Files 24 24 Lines 2255 2255 ==========================================
- Hits 873 865 -8 - Misses 1207 1212 +5 - Partials 175 178 +3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemccracken
mikemccrackenforce-pushed the 2025.04.24/main/attempt-mount-umount-mount-repro branch from f9d96da to f29d9b7CompareApril 24, 2025 22:46
@hallyn

Copy link
Copy Markdown
Contributor

I slightly tweaked your test and put it in its own file test/priv-mount-meta.bats:

load helpers
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
function setup_file() {
check_root
build_image_at $BATS_SUITE_TMPDIR
export MY_MNTNSNAME=$(readlink /proc/self/ns/mnt | cut -c 6-15)
}
function setup() {
export MP=${BATS_TEST_TMPDIR}/testmountpoint
mkdir -p $MP
}
@test "RO mount/umount/remount/umount of good image works" {
echo "MP is $MP" >&3
env >&3
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
echo "after first mount:" >&3
find $MP >&3
run atomfs-cover --debug umount $MP
assert_success
# mount point and meta dir should exist but be empty:
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
echo "after umount:" >&3
find $MP >&3
# rinse, repeat:
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
assert_success
echo "after second mount:" >&3
find $MP >&3
assert_file_exists $MP/1.README.md
assert_file_exists $MP/random.txt
run atomfs-cover --debug umount $MP
assert_success
assert_dir_exists $MP
assert [ -z $( ls -A $MP) ]
}

And this test does in fact fail:

root@atomfs:/home/ubuntu/atomfs# cd test
root@atomfs:/home/ubuntu/atomfs/test# bats priv-mount-meta.bats
priv-mount-meta.bats
RO mount/umount/remount/umount of good image works 1/1
MP is /tmp/bats-run-xKU0cN/test/1/testmountpoint
SHELL=/bin/bash
BATS_TEST_TMPDIR=/tmp/bats-run-xKU0cN/test/1
SUDO_GID=1000
MY_MNTNSNAME=4026531841
MP=/tmp/bats-run-xKU0cN/test/1/testmountpoint
BATS_SUITE_TMPDIR=/tmp/bats-run-xKU0cN/suite
BATS_ROOT_PID=30770
BATS_WARNING_FILE=/tmp/bats-run-xKU0cN/warnings.log
BATS_FILE_TMPDIR=/tmp/bats-run-xKU0cN/file/0
BATS_END_CODE_QUOTE='
SUDO_COMMAND=/usr/bin/bash
SUDO_USER=ubuntu
BATS_TEST_SOURCE=/tmp/bats-run-xKU0cN/bats.30793.src
BATS_TEST_NAME=test_RO_mount-2fumount-2fremount-2fumount_of_good_image_works
PWD=/tmp/bats-run-xKU0cN/suite
LOGNAME=root
BATS_TMPDIR=/tmp
HOME=/root
LANG=en_US.UTF-8
BATS_TEST_FILENAME=/home/ubuntu/atomfs/test/priv-mount-meta.bats
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wm ✗ RO mount/umount/remount/umount of good image works v=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
BATS_RUN_TMPDIR=/tmp/bats-run-xKU0cN
BATS_VERSION=1.10.0
BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
BATS_CWD=/home/ubuntu/atomfs/test
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=tmux-256color
BATS_LINE_REFERENCE_FORMAT=comma_line
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
BATS_BEGIN_CODE_QUOTE=`
BATS_TEMPDIR_CLEANUP=1
SHLVL=4
BATS_TEST_FILTER=
BATS_TEST_RETRIES=0
BATS_RUNLOG_FILE=/dev/null
BATS_TEST_NUMBER=1
PATH=/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/home/ubuntu/atomfs/test/../tools/bin:/home/ubuntu/atomfs/test/../bin:/usr/libexec/bats-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
BATS_LIB_PATH=/usr/lib/bats
BATS_LIBEXEC=/usr/libexec/bats-core
BATS_SUITE_TEST_NUMBER=1
BATS_ROOT=/usr
OLDPWD=/home/ubuntu/atomfs/test
BATS_SAVED_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BASH_FUNC_bats_readlinkf%%=() { readlink -f "$1"
}
_=/usr/bin/env
after first mount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
/tmp/bats-run-xKU0cN/test/1/testmountpoint/1.README.md
/tmp/bats-run-xKU0cN/test/1/testmountpoint/random.txt
after umount:
/tmp/bats-run-xKU0cN/test/1/testmountpoint
(from function `assert_success' in file test_helper/bats-assert/src/assert_success.bash, line 45,
in test file priv-mount-meta.bats, line 39)
`assert_success' failed
-- command failed --
status : 1
output (20 lines):
warning: GOCOVERDIR not set, no coverage data emitted
2025/07/04 21:53:54 debug -> ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug <- ws.recurse digest=sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0
2025/07/04 21:53:54 debug casext.ResolveReference(test-squashfs) got these descriptors refs=[{[{application/vnd.oci.image.manifest.v1+json sha256:b144017a316705091185f3acdc4f8950ed06f1f8ca9ff23a33bbd050b5e0dbb0 1150 [] map[org.opencontainers.image.ref.name:test-squashfs] [] <nil> }]}]
Error: "/run/atomfs/meta/4026531841/tmp-bats-run-xKU0cN-test-1-testmountpoint" exists: cowardly refusing to mess with it
couldn't mount molecule at mntpt "/tmp/bats-run-xKU0cN/test/1/testmountpoint"
main.doMount
/home/ubuntu/atomfs/cmd/atomfs/mount.go:113
github.com/urfave/cli.HandleAction
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524
github.com/urfave/cli.Command.Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175
github.com/urfave/cli.(*App).Run
/home/ubuntu/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277
main.main
/home/ubuntu/atomfs/cmd/atomfs/main.go:38
runtime.main
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/proc.go:272
runtime.goexit
/home/ubuntu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/asm_amd64.s:1700
--
1 test, 1 failure
root@atomfs:/home/ubuntu/atomfs/test#
exit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikemccracken@hallyn