# basic-auth tests - as-set and aut-num objects


# ################### as-set and aut-num objects
#
# These tests are for the "set" object which can have hierarchical names. 
# The goal is to make sure all hierarchies are parsed correctly and 
# correct authorisation applies.
# The objects for which these rules apply are:
# as-set
# route-set
# rtr-set
# peering-set
# rtr-set
# filter-set
#
# The tests are done for as-set object only, because auth for all these objects 
# is handled by the same piece of code.

# CASE 1: We try to create as-set object with 2-level hierarchical name AS123:AS-TEST
# parent aut-num object exists and auth is given for both set and parent.
# AS123 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#SUCCESS
#
# RESULT 1: The creation will succeed.


# CASE 2: We try to create as-set object with 2-level hierarchical name AS123:AS-TEST
# parent aut-num exists, no auth for parent is given
# AS123 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#FAILURE
#
# RESULT 2: The creation will fail.


# CASE 3: We try to create as-set object with 3-level hierarchical name AS123:AS-TEST1:AS-TEST
# parent as-set object exists. auth for set and parent is given
# AS123:AS-TEST1 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#SUCCESS
#
# RESULT 3: The creation will succeed.


# CASE 4: We try to create as-set object with 3-level hierarchical name AS123:AS-TEST1:AS-TEST
# parent as-set exists, no auth for parent is given
# AS123:AS-TEST1 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#FAILURE
#
# RESULT 4: The creation will fail.


# CASE 5: We try to create as-set object with 2-level hierarchical name AS-TEST1:AS-TEST
# parent as-set exists, auth for set and parent is given
# AS-TEST1 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#SUCCESS
#
# RESULT 5: The creation will succeed.


# CASE 6: We try to create as-set object with 2-level hierarchical name AS-TEST1:AS-TEST
# parent as-set exists, no auth for parent is given
# AS-TEST1 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#FAILURE
#
# RESULT 6: The creation will fail.


# CASE 7: We try to create as-set object with 2-level hierarchical name AS123:AS-TEST
# parent aut-num doesn't exist
# we try to create under it 
#
% requires initial objects to be loaded
%
# create as-set object
#
#FAILURE
#
# RESULT 7: The creation will fail.


# CASE 8: We try to update as-set object with 2-level hierarchical name AS123:AS-TEST
# parent aut-num doesn't exist
# we try to update set under it
#
% requires initial objects to be loaded
%
# update as-set object
#
#SUCCESS
#
# RESULT 8: The modification will succeed.


# CASE 9: We try to delete aut-num object AS123 which is a parent for as-set AS123:AS-TEST
# deleting parent, auth for parent is given
#
% requires initial objects to be loaded
%
# delete aut-num object
#
#SUCCESS
#
# RESULT 9: The deletion will succeed.


# CASE 10: We try to create as-set object with 2-level hierarchical name AS123:AS-TEST
# parent has mnt-lower, auth for mnt-lower is given
#
% requires initial objects to be loaded
%
# create as-set object
#
#SUCCESS
#
# RESULT 10: The creation will succeed.


# CASE 11: We try to create as-set object with 2-level hierarchical name AS123:AS-TEST
# parent has mnt-lower, no auth for mnt-lower is given
#
% requires initial objects to be loaded
%
# create as-set object
#
#FAILURE
#
# RESULT 11: The creation will fail.


# CASE 12: We try to create as-set object with 3-level hierarchical name AS123:AS-TEST1:AS-TEST
# grand-parent exists, parent doesn't exist. auth for child is given
#
% requires initial objects to be loaded
%
# create as-set object
#
#FAILURE
#
# RESULT 12: The creation will fail.


# CASE 13: We try to create a parent aut-num object AS123 when child as-set AS123:AS-TEST exists
# re-create a parent having existing child, password for parent is given
#
% requires initial objects to be loaded
%
# create aut-num object
#
#SUCCESS
#
# RESULT 13: The creation will succeed.


# CASE 14: We try to create as-set object with 3-level hierarchical name AS123:AS123:AS-TEST
# AS123 aut-num object exists and auth is given for both set and aut-num.
# AS123 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#FAILURE
#
# RESULT 14: The creation will fail.


# CASE 15: We try to create as-set object with 2-level hierarchical name AS-TEST:AS123
# AS-TEST as-set object exists and auth is given for both sets
# AS123 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#SUCCESS
#
# RESULT 15: The creation will succeed.


# CASE 16: We try to create as-set object with 3-level hierarchical name AS123:AS-TEST:AS123
# AS123 aut-num object exists and auth is given for both aut-num and as-set
# AS123 protected by RIPE-NCC-HM-MNT  # hostmaster
#
% requires initial objects to be loaded
%
# create as-set object
#
#SUCCESS
#
# RESULT 16: The creation will succeed.


# CASE 17: We try to create as-set object with 2-level hierarchical name AS-TEST:AS-TEST
# parent exists
# auth for parent is given
#
% requires initial objects to be loaded
%
# create as-set object
#
#SUCCESS
#
# RESULT 17: The creation will succeed.


# CASE 18: We try to create as-set object with 2-level hierarchical name AS123:AS123
# should get syntax error
#
% requires initial objects to be loaded
%
# create as-set object
#
#FAILURE
#
# RESULT 18: The creation will fail.


