blob: fc579d94eb64ed7cb8f88121bfdf1476aa9f04ba [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <fidl/fuchsia.io/cpp/wire.h>
#include "src/sys/appmgr/integration_tests/sandbox/namespace_test.h"
namespace fio = fuchsia_io;
TEST_F(NamespaceTest, HasPkg) {
ExpectExists("/pkg");
// TODO(fxbug.dev/37858): pkgfs/thinfs do not properly support hierarchical directory rights so
// the StrictRights test fails on the directory, switch to that once fixed. The file test still
// should succeed, although it returns NOT_SUPPORTED instead of ACCESS_DENIED because of pkgfs
// differences.
ExpectPathSupportsRights(
"/pkg", fio::wire::OpenFlags::kRightReadable | fio::wire::OpenFlags::kRightExecutable);
ExpectPathSupportsStrictRights(
"/pkg/bin/has_pkg",
fio::wire::OpenFlags::kRightReadable | fio::wire::OpenFlags::kRightExecutable,
/*require_access_denied=*/false);
}