source: tests/example_scripts/wiki/attr3.py @ 7c748c9

abac0-leakabac0-mei
Last change on this file since 7c748c9 was 7c748c9, checked in by Mei <mei@…>, 6 years ago

1) more new tests

  • Property mode set to 100755
File size: 833 bytes
Line 
1#!/usr/bin/env python
2"""
3attr3.py
4
5  test different versions of attribute rule xml format
6
7"""
8import os
9import ABAC
10
11i = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600)
12a = ABAC.Attribute(i, "role", 3600)
13# Here's the format change
14a.set_output_format("GENIv1.0")
15# Format change above
16a.principal(i.keyid());
17a.bake()
18a.write_file("V1_attr.xml")
19
20####
21i2 = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600)
22a2 = ABAC.Attribute(i, "role", 3600)
23# Here's the format change
24a2.set_output_format("GENIv1.1")
25# Format change above
26
27a2.principal(i2.keyid());
28a2.bake()
29a2.write_file("V1_1_attr.xml")
30
31####
32i3 = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600)
33a3 = ABAC.Attribute(i, "role", 3600)
34a3.principal(i3.keyid());
35a3.bake()
36a3.write_file("V1_1b_attr.xml")
37
38print a.get_output_format()+a2.get_output_format()+a3.get_output_format()
39
40
Note: See TracBrowser for help on using the repository browser.