Skip to content

Commit

Permalink
test: test old behaviour of managedLayers policy
Browse files Browse the repository at this point in the history
  • Loading branch information
jkloetzke committed Nov 2, 2024
1 parent b44449f commit 55525f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/black-box/layers-checkout/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ run_bob layers update -DBAR_1_COMMIT=${bar_c1} -DBAR_2_COMMIT=${bar_c1} -DBAR_DI
-lc layers_overrides -vv
expect_exist layers/foo/override

# test that layers status/update are rejected on the old managedLayers policy
old_dir="$tmp_dir/legacy"
mkdir -p "$old_dir/recipes"
expect_fail run_bob -C "$old_dir" layers update
expect_fail run_bob -C "$old_dir" layers status

# remove layers + clean
cleanup
rm -rf layers
16 changes: 16 additions & 0 deletions test/unit/test_input_recipeset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,22 @@ def testMinimumVersion(self):
})
self.assertRaises(ParseError, self.generate)

def testManagedRejected(self):
self.writeConfig({
"bobMinimumVersion" : "0.25rc1",
"layers" : [
{
"name" : "l1_n1",
"scm" : "git",
"url" : "[email protected]:bob.git",
}
]
})
with self.assertRaises(ParseError) as err:
self.generate()
self.assertEqual(err.exception.slogan,
"Managed layers aren't enabled! See the managedLayers policy for details.")

class TestIfExpression(RecipesTmp, TestCase):
""" Test if expressions """
def setUp(self):
Expand Down

0 comments on commit 55525f2

Please sign in to comment.