We consider the problem of computing optimal linear control policies for linear systems in finite-horizon. The states and the inputs are required to remain inside pre-specified safety sets at all times despite unknown disturbances. In this technical note, we focus on the requirement that the control policy is distributed, in the sense that it can only be based on partial information about the history of the outputs. It is well-known that when a condition denoted as Quadratic Invariance (QI) holds, the optimal distributed control policy can be computed in a tractable way. Our goal is to unify and generalize the class of information structures over which quadratic invariance is equivalent to a test over finitely many binary matrices. The test we propose certifies convexity of the output-feedback distributed control problem in finite-horizon given any arbitrarily defined information structure, including the case of time varying communication networks and forgetting mechanisms. Furthermore, the framework we consider allows for including polytopic constraints on the states and the inputs in a natural way, without affecting convexity.