Date: Wed, 14 Aug 2019 18:04:04 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351039 - head/tests/sys/fs/fusefs Message-ID: <201908141804.x7EI44Ae090387@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Wed Aug 14 18:04:04 2019 New Revision: 351039 URL: https://svnweb.freebsd.org/changeset/base/351039 Log: fusefs: fix intermittency in the default_permissions.Unlink.ok test The test needs to expect a FUSE_FORGET operation. Most of the time the test would pass anyway, because by chance FUSE_FORGET would arrive after the unmount. MFC after: 2 weeks MFC-With: 350665 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/fs/fusefs/default_permissions.cc Modified: head/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- head/tests/sys/fs/fusefs/default_permissions.cc Wed Aug 14 17:36:26 2019 (r351038) +++ head/tests/sys/fs/fusefs/default_permissions.cc Wed Aug 14 18:04:04 2019 (r351039) @@ -40,6 +40,7 @@ extern "C" { #include <sys/extattr.h> #include <fcntl.h> +#include <semaphore.h> #include <unistd.h> } @@ -1157,12 +1158,19 @@ TEST_F(Unlink, ok) const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0777, UINT64_MAX, 1); expect_lookup(RELPATH, ino, S_IFREG | 0644, UINT64_MAX, geteuid()); expect_unlink(FUSE_ROOT_ID, RELPATH, 0); + expect_forget(ino, 1, &sem); ASSERT_EQ(0, unlink(FULLPATH)) << strerror(errno); + + sem_wait(&sem); + sem_destroy(&sem); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908141804.x7EI44Ae090387>