Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 # auth_token middleware now requires access to HOME, otherwise
4 # test suite cause FTBFS. See (LP: #1031022)
5 export HOME="$(CURDIR)/debian/tests/"
6
7 # This is to avoid git clone of keystoneclient when running unit tests.
8 # See https://review.openstack.org/122768/
9 export KSCTEST_PATH=/usr/lib/python3/dist-packages/keystoneclient
10
11 include /usr/share/openstack-pkg-tools/pkgos.make
12
13 %:
14 dh $@ --buildsystem=pybuild --with python3,sphinxdoc
15
16 override_dh_clean:
17 rm -rf $(CURDIR)/build $(CURDIR)/keystone.egg-info $(CURDIR)/.cache
18 rm -rf $(CURDIR)/keystone/test/keystone.sql.log $(CURDIR)/keystone/test/keystone.ldap.log
19 rm -rf $(CURDIR)/doc/build .pybuild
20 # NOTE(adam_g) The following stuff is built in /doc/source. Safe for now, but
21 # should be fixed upstream or updated here post-essex
22 rm -rf $(CURDIR)/doc/source/keystone*.rst
23 rm -rf $(CURDIR)/doc/source/modules.rst
24 rm -rf $(CURDIR)/doc/source/sourcecode $(CURDIR)/doc/source/api
25 rm -f $(CURDIR)/doc/source/_static/keystone.conf.sample
26 rm -f $(CURDIR)/doc/source/_static/keystone.policy.yaml.sample
27 rm -rf $(CURDIR)/admin.log $(CURDIR)/keystone-legacy-auth.log
28 rm -f $(CURDIR)/debian/keystone.config $(CURDIR)/debian/keystone.postinst debian/keystone.service debian/keystone.init
29 find $(CURDIR)/keystone/tests -name '*.db' -delete
30 rm -rf $(CURDIR)/vendor keystone/tests/unit/tmp keystone/tests/tmp
31 rm -rf $(CURDIR)/.stestr '"'
32 rm -f $(CURDIR)/debian/tests/testing.db
33 rm -f $(CURDIR)/debian/keystone.keystone*.init $(CURDIR)/debian/keystone.keystone*.service $(CURDIR)/debian/keystone.keystone*.upstart
34 find $(CURDIR) -name '*.pyc' -delete
35 for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done
36 rm -f AUTHORS ChangeLog
37 dh_clean
38
39 override_dh_auto_build:
40 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func keystone.config
41 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func keystone.postinst
42
43 override_dh_auto_clean:
44 python3 setup.py clean
45
46 override_dh_auto_test:
47 echo "Do nothing..."
48
49 override_dh_auto_install:
50 echo "Doing nothing..."
51
52 override_dh_install:
53 for i in $(PYTHON3S) ; do \
54 PYTHON=python$$i python$$i setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp ; \
55 done
56
57 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
58 # See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1078623
59 # and https://bugs.launchpad.net/keystone/+bug/2076992
60 # test_v3_auth\.TrustAPIBehavior\.test_redelegate_with_role_by_name
61 # test_v3_auth\.TrustAPIBehavior\.test_redelegation_terminator
62 # test_v3_auth\.TrustAPIBehavior\.test_roles_subset
63 # test_v3_auth\.TestTrustAuthFernetTokenProvider\.test_redelegate_with_role_by_name
64 # test_v3_auth\.TestTrustAuthFernetTokenProvider\.test_redelegation_terminator
65 # test_v3_auth\.TestTrustAuthFernetTokenProvider\.test_roles_subset
66 # Not indenpotent:
67 # test_cli\.CliBootStrapTestCase\.test_bootstrap_is_not_idempotent_when_password_does_change
68 @echo "===> Running tests"
69 mkdir -p $(CURDIR)/keystone/tests/tmp
70 pkgos-dh_auto_test --no-py2 'keystone\.tests\.unit\.(?!(.*test_v3_federation\.SAMLGenerationTests\.test_sign_assertion_exc.*|.*test_sql_upgrade.FullMigration.*|.*test_hacking_checks\.TestCheckForMutableDefaultArgs\.test.*|.*common\.test_notifications\.NotificationsTestCase.*|.*test_v3_auth\.TestAuthInfo\.test_get_method_names_duplicates.*|.*test_backend_sql\.SqlCatalog\.test_get_service_returns_not_found.*|.*tests\.test_core\.TestTestCase\.test_deprecation_warnings_are_raised_as_exceptions_in_tests.*|.*test_v3_federation.*SAMLGenerationTests.*test_sign_assertion_logs_message_if_xmlsec1_is_not_installed.*|test_v3_auth\.TrustAPIBehavior\.test_redelegate_with_role_by_name|test_v3_auth\.TrustAPIBehavior\.test_redelegation_terminator|test_v3_auth\.TrustAPIBehavior\.test_roles_subset|test_v3_auth\.TestTrustAuthFernetTokenProvider\.test_redelegate_with_role_by_name|test_v3_auth\.TestTrustAuthFernetTokenProvider\.test_redelegation_terminator|test_v3_auth\.TestTrustAuthFernetTokenProvider\.test_roles_subset|test_v3_federation\.SAMLGenerationTests\.test_saml_signing|test_v3_assignment\.AssignmentInheritanceTestCase\.test_project_id_specified_if_include_subtree_specified|test_cli\.CliBootStrapTestCase\.test_bootstrap_is_not_idempotent_when_password_does_change|test_policy\.GeneratePolicyFileTestCase\.test_policy_generator_from_command_line|test_cli\.CliBootStrapTestCase\.test_bootstrap_is_not_idempotent_when_password_does_change))'
71 endif
72
73 rm -rf $(CURDIR)/debian/tmp/usr/etc
74 dh_install
75 dh_missing --fail-missing
76 rm -rf debian/python3-keystone/usr/lib/python*/*/doc
77 rm -rf debian/python3-keystone/usr/lib/python*/*/tools
78 rm -rf debian/python3-keystone/usr/lib/python*/*/examples
79 install -D -m 0600 $(CURDIR)/debian/logging.conf $(CURDIR)/debian/keystone/etc/keystone/logging.conf
80 mkdir -p $(CURDIR)/debian/keystone/usr/share/keystone
81 PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \
82 --output-file $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf \
83 --wrap-width 140 \
84 --namespace keystone \
85 --namespace oslo.cache \
86 --namespace oslo.log \
87 --namespace oslo.messaging \
88 --namespace oslo.policy \
89 --namespace oslo.db \
90 --namespace oslo.middleware \
91 --namespace osprofiler
92 pkgos-fix-config-default $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf catalog template_file /etc/keystone/default_catalog.templates
93 pkgos-fix-config-default $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf DEFAULT log_dir /var/log/keystone
94 pkgos-fix-config-default $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf DEFAULT log_file keystone.log
95 pkgos-fix-config-default $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf federation sso_callback_template /etc/keystone/sso_callback_template.html
96
97 mkdir -p $(CURDIR)/debian/keystone/etc/keystone/policy.d
98 PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslopolicy-sample-generator \
99 --output-file $(CURDIR)/debian/keystone/etc/keystone/policy.d/00_default_policy.yaml \
100 --namespace keystone
101
102 # Comment out deprecated policies
103 sed -i 's/^"/#"/' $(CURDIR)/debian/keystone/etc/keystone/policy.d/00_default_policy.yaml
104
105 # Use the policy.d folder
106 pkgos-fix-config-default $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf oslo_policy policy_dirs /etc/keystone/policy.d
107
108 install -D -m 0644 debian/keystone.apparmor $(CURDIR)/debian/keystone/etc/apparmor.d/usr.bin.keystone-all
109 dh_apparmor --profile-name=usr.bin.keystone-all
110
111 override_dh_sphinxdoc:
112 ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
113 PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/keystone-doc/usr/share/doc/keystone-doc/html
114 dh_sphinxdoc
115 endif
116
117 override_dh_installman:
118 ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
119 PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b man doc/source doc/build/man
120 dh_installman
121 endif
122
123 override_dh_python3:
124 dh_python3 --shebang=/usr/bin/python3
125
126 #override_dh_installmenu:
127 # dh_installinit --name=keystone-admin
128 # dh_installinit --name=keystone-public